The usual reason people move GitHub Actions jobs to their own machines is the monthly allowance. A private repo on the free plan gets $12 of runner time a month, which is about 2,000 minutes on the standard Linux runner, and a busy repo can burn through that in a couple of weeks. Self-hosted runners don't count against it.
I wanted to see what you actually get when you move a real job onto DigitalOcean Droplets: how fast it runs, how long it waits, and what each run costs. So I took one CI job and ran it 39 times across GitHub's runner, an always-on Droplet, and Droplets that exist for one job each.
The job
A private repo with ripgrep 14.1.1 in it, Rust pinned to 1.88. The job checks out the code, builds a release binary with the PCRE2 feature, and runs the whole test suite. It's a normal Rust CI job: compile-heavy, a couple of minutes long, nothing exotic.
Every run went through the same workflow file, and I read the timings back from the GitHub API: when the run was created, when the job started, when it finished. The gap between the first two is the queue time, which matters as much as the job itself once you bring your own machines.
The workflow, the scripts that created and deleted the Droplets, and the raw timings are all in DimitrovK/ci-runner-lab on GitHub.
GitHub's runner
The standard runner for a private repo has 2 vCPUs and 7 GB of memory. Mine landed on AMD EPYC machines every time.
- With nothing cached, the job took 96 to 136 seconds, median 112.
- With
actions/cacherestoring the cargo registry and thetargetdirectory, it took 68 to 76 seconds, even after changing a source file. - Queue time was 4 or 5 seconds on every run.
GitHub bills each job in whole minutes, rounded up, at $0.006 a minute. So almost every run here cost 2 minutes, $0.012, and the slowest cold one cost 3. That rounding matters for short jobs: a 70 second job pays for 120.
An always-on Droplet
The first setup most people try is one Droplet that stays up and runs every job. I used a Basic s-4vcpu-8gb, $48 a month, registered as a self-hosted runner.
The first five runs were slower than GitHub's: 166 to 181 seconds each, against a median of 112 for GitHub's uncached run. Part of that is the CPU. A Basic Droplet shares its vCPUs with other tenants, and for a build from nothing, GitHub's two EPYC cores beat its four shared ones. For build machines, the Premium and CPU-Optimized sizes below are the better fit. But the run after the first one should never have been a build from nothing. actions/checkout runs git clean -ffdx by default, which deletes everything not in the repo, and target/ is not in the repo. Every run threw away the previous build and compiled from scratch.
With clean: false on the checkout step, the build directory survives between jobs, and this is where a machine you own pays off:
- No code change: 31 to 34 seconds.
- One source file changed before each run, like a normal commit: 52 to 58 seconds.
That's the fastest result in the whole test, faster than GitHub's runner with its cache restored, because nothing has to be downloaded or unpacked. Cargo only rebuilds what changed.
The catch is that it's one machine. I sent four jobs at once and they ran one after another. The first started after 4 seconds, the last after 320. GitHub would have started all four straight away on separate runners. If your team pushes in bursts, one always-on runner turns into a queue. You need several, or a bigger box running several runners side by side.
A fresh Droplet for every job
The other approach is a Droplet that's created when a job is queued and deleted when it finishes. Every job gets a clean machine, nothing piles up on disk, and you only pay while it runs. DigitalOcean bills Droplets per second, with a 60 second minimum, so a Droplet that lives for three minutes costs three minutes.
I drove it from a small script: ask GitHub for a single-use runner config, trigger the workflow, create the Droplet with that config in its user data, wait, delete it. In production this would be a webhook, but the timings are the same.
From the stock Ubuntu image, on a CPU-Optimized c-4 in London, the job started 116 seconds after it was queued. About 35 of that was the Droplet booting and 80 was installing build tools, Rust and the runner. The job itself took 110 to 113 seconds.
Baking all of that into a snapshot only helped a little. A Droplet created from my 3.8 GB snapshot took around 50 seconds to become active instead of 35, so the job started after 98 seconds instead of 116. The install time went away, but some of it came back as boot time.
Then I tried three sizes from the same snapshot:
-
c-4, 4 dedicated vCPUs at $0.125 an hour: job median 112 seconds, about 3.5 minutes from queue to done, $0.0073 a run. - Premium AMD
s-4vcpu-8gb-amdat $0.083 an hour: job 95 to 110 seconds, about 3.3 minutes in total, $0.0045 a run. -
c-8, 8 dedicated vCPUs at $0.25 an hour: job 59 to 74 seconds, about 2 minutes in total, $0.0087 a run.
Every one of those is cheaper per run than GitHub's $0.012, and the c-8 ran the job itself in a little over half the time of GitHub's uncached run. What you give up is the wait at the start: a minute and a half to start a job is fine for a nightly build and annoying for a pull request someone is watching.
One thing that cost me a run: the CPU-Optimized sizes weren't available in Frankfurt when I tested, only in London, so I moved the throwaway Droplets there and copied the snapshot over. It took 83 seconds. If you pick a region for runners, check the size list for it first with doctl compute region list.
What it costs a month
For a repo that runs this job 1,000 times a month:
- GitHub's runner: about 2,000 billed minutes, $12, which is roughly the whole free allowance.
- One always-on Basic Droplet: $48 flat, whether you run 10 jobs or 10,000, and the fastest feedback on small changes.
- A fresh Premium AMD Droplet per job: about $4.50, with a minute and a half of startup on every run.
- A fresh
c-8per job: about $8.70, and the job itself finishes in about half the time.
At this size GitHub is cheap, and I wouldn't move just to save money. The reasons to move are the ones that showed up in the timings: a warm build directory that cuts a run to under a minute, bigger machines billed by the second, and no monthly cap to plan around. The per-run cost of a throwaway Droplet only starts to matter at several thousand runs a month, and then the Premium AMD runs come to a little over a third of GitHub's price.
What I'd take from it
- If you self-host for speed, set
clean: falseonactions/checkout, or your runner rebuilds from scratch every time and loses to GitHub's. - One always-on runner is fastest for one person and a queue for a team. Four simultaneous jobs meant the last one waited over five minutes.
- Throwaway Droplets with per-second billing cost under a cent a run, but expect 60 to 120 seconds before the job starts.
- A pre-baked snapshot saved less than I expected, about 20 seconds, because a larger image boots slower.
- Check which sizes your region offers before you design around one.
Caveats
One job, one language, 39 runs in a single morning. A job that downloads more, or caches better, will shift the numbers. GitHub's runners landed on different CPU models between runs, and so did the c-8 Droplets. The monthly figures are arithmetic from these medians, not a month of real traffic, and the throwaway Droplets were driven by a script on my laptop rather than a webhook. GitHub's billing docs say self-hosted runners are free and don't use the included minutes; that's how it stood when I wrote this.
Top comments (4)
Useful numbers. One thing the cost table doesn't show: the always-on Droplet also keeps whatever the previous job left behind. A token written to ~/.npmrc, a modified cache, or a process started by some dependency's postinstall is still there when the next job starts. The fresh-Droplet setup gets that isolation for free, which is a decent reason to prefer it beyond the bill.
And if the repo ever goes public, GitHub's docs recommend using self-hosted runners only with private repositories, since a pull request from a fork can run its code on your machine.
Agreed, and it's the part I underplayed. The always-on runner in my test only ran jobs from one repo I control, so whatever a job left behind was a speed win, not a risk. Once a runner takes jobs from code you don't fully trust, a token in
~/.npmrc, a background process or a poisoned file intarget/is sitting there for the next job. The fresh Droplets each got a single-use runner config, so every machine ran exactly one job and was then deleted.On the public part: the test repo is public now, and its LAB.md says the same thing. No runner is attached to it any more, and I wouldn't attach one.
The
clean: falsefinding is the one I'd underline. A couple of things that show up once that warmtarget/has lived for a few weeks:target/, and every toolchain bump or feature change leaves another set of artifacts behind. On a persistent runner it's worth a weeklycargo sweep --time 7(or justrm -rf targeton a schedule) before the disk fills mid-job._workdir by default, so they don't share a build dir. If you point them at a sharedCARGO_TARGET_DIRto keep one warm cache, the jobs serialize on Cargo's "Blocking waiting for file lock on build directory".incremental = falseby default, so a changed file rebuilds its whole crate. For a multi-crate workspace the warm-runner gap gets bigger than ripgrep shows.There's also a middle option between your two setups: throwaway Droplets with
sccachepointed at a Spaces bucket (it speaks S3). You keep the clean-machine isolation cryptostrapon mentioned and get most of the compile reuse back. The cache download replaces part of the rebuild, so it lands between your fresh and warm numbers. I'd be curious where exactly on thec-8.You're right about incremental. The release profile has it off, so each of the 52 to 58 second runs rebuilt the whole ripgrep binary crate plus the link, and the other crates in the workspace were reused as they were. ripgrep is a small workspace, so the gap would be bigger on a larger one.
I didn't keep the warm runner long enough to watch
target/grow, it was one morning. Cargo 1.88 started cleaning old downloads out of~/.cargoby itself, but it leavestarget/alone, so a scheduledcargo sweeporrm -rfis the fix.I haven't tried sccache on Spaces. It should connect, since sccache's S3 backend takes a custom endpoint. What I'd expect to limit it here is that sccache can't cache crates that call the linker, bin crates included, and the crate I changed in every run was ripgrep's binary. So the dependencies would come out of the cache and the part that changed would still build from scratch. A $5 Spaces bucket is a cheap way to find out where that lands on the c-8.