Hraness

Writing

Moving off GitHub Actions (staying on GitHub)

Ben Guo ·

I started building more closed-source projects with agents, and my CI costs started to grow out of control. GitHub Actions is free for public repos. Private repos pay by the minute, and agents open a lot of pull requests.

pull requests
1,541
CI runs
10,504
private repos
40
One week, November 16 to 22. That's twice the week before.

My worst day cost $216, mostly in Mac minutes.

A lot of ink has been spilled about how GitHub is bad and unreliable. I wasn't ready to move off GitHub entirely, but I realized I could move off GitHub Actions quite easily. The code, the pull requests and the required checks all stay on GitHub. What changes is one line in each workflow:

- runs-on: macos-26+ runs-on: [self-hosted, laptop]
- runs-on: ubuntu-24.04+ runs-on: [self-hosted, cloudflare]

First, run less

Before moving anything, make the jobs you already have run less often. It's free.

Mac: a spare laptop

Mac CI is obscenely expensive. On GitHub, a minute of Mac costs ten times a minute of Linux.

What one minute costs on GitHub

  1. Linux0.6¢
  2. Mac6.2¢

And most of what I build is Mac apps. Yaptake edits video with a transcript. Textmock makes iMessage mockups. Sponge keeps your reading close. OH supervises Claude Code and Codex sessions. DAWN composes music in TypeScript and has a desktop app. Their builds and tests need a Mac, and some need a real, logged-in desktop.

So first I set up a spare laptop as a self-hosted runner, an M4 Max MacBook Pro that wasn't doing much. It turned out to be faster than GitHub's Mac runners, too:

One build of Yaptake's app

  1. GitHub's Mac runner16½ min
  2. My spare laptop3½ min

The setup:

  1. Make a second macOS user for the runner and leave it logged in. A separate user keeps CI out of your files, and the login gives app tests a desktop, which a background service doesn't get.
  2. Install what the jobs need. For me that's Xcode, Rust, Bun and Node.
  3. In your org's Actions settings, make a runner group that only private repos can use. On a public repo, a stranger's pull request could run code on your laptop.
  4. As the runner user, download the runner, register it to that group with a label, and install it as a login service.
  5. Change runs-on to that label.
./config.sh --url https://github.com/YOUR-ORG --token TOKEN \
  --runnergroup mac --labels laptop
./svc.sh install && ./svc.sh start

After the first day I added two things. Each workflow starts with a five-second job on the laptop that fails fast if it's logged out or offline, so runs don't sit in the queue forever. And jobs clean up after themselves, because the laptop keeps whatever the last job left behind. That includes the build cache, which helps.

Last week it ran about 900 builds. The catch is that one laptop runs one job at a time, so when agents push six branches at once, Mac jobs wait their turn. I've seen one wait half an hour.

Linux: Cloudflare

Then I looked at the bill for Linux Actions, and realized I could find much cheaper compute. My Linux jobs are small and there are lots of them: type checks, test shards, site builds, about a minute and a half each, often forty at once. Every project has some, and yiii, which teaches Mandarin and Spanish, needs nothing else.

Here's what the same jobs would cost elsewhere, for every dollar they cost on GitHub:

$1 of GitHub's Linux minutes, elsewhere

  1. GitHub$1.00
  2. WarpBuild67¢
  3. Blacksmith66¢
  4. Namespace38¢
  5. Cloudflare Containers37¢
  6. RunsOn on AWS spot24¢
  7. Ubicloud20¢
  8. Hetzner, your own servers19¢
List prices on 23 November 2026, worked out for my jobs.

Cloudflare seemed like the most reasonable option, even though it isn't the cheapest. If all you want is a smaller bill, look at Ubicloud or run your own Hetzner servers. I already use Cloudflare for a number of other things (love R2 and D1), so it was an easy switch: no new account, no servers, billing by the second, and nothing running when nobody pushes.

Cloudflare doesn't sell CI runners. It sells Containers, and a runner takes four pieces:

  1. A GitHub App on your org, allowed to manage its self-hosted runners, sends a workflow_job webhook to a Worker whenever a job is queued.
  2. If the job asks for your label, a Durable Object starts a fresh container (mine are 4 vCPU, 5 GiB of memory, 20 GB of disk) and asks GitHub for a just-in-time runner, good for one job.
  3. The container runs GitHub's stock runner, does that job and exits. Nothing carries over between jobs.
  4. Every 30 seconds the Durable Object checks GitHub's queue against what's running, to catch missed webhooks and stuck containers.

It needs the Workers Paid plan ($5 a month), one wrangler deploy for the Worker and the container image, and another private-only runner group. I tried it on one repo for a day and moved the rest over the next two. Jobs start about 15 seconds after they're queued.

Update: a Hetzner server too

A day later I added a Hetzner server, 8 vCPUs and 16 GB of memory for $69 a month. I didn't rent it for CI. I rented it to run coding agents for OH, so sessions keep going when my laptop is closed. No agents run there yet, so CI went first. Agents spend most of their time waiting on a model, so CI should still have room once they arrive.

The agents come first. CI gets two jobs at a time, each on 4 vCPUs and 5 GiB of memory, and all of them together get a fifth of the CPU weight the agents get. The kernel takes memory back from jobs before it touches the agents. If the agents need more room, I turn the CI slots down to one or zero and Cloudflare picks up the rest. As a CI server on its own, $69 a month wouldn't pay for itself.

It runs the same container image as Cloudflare. It gets first pick of jobs from private repos, and Cloudflare takes the rest, plus everything whenever the server is full or offline. Nothing in the workflows changed. In its first eight hours it ran 119 jobs, about a third of the Linux work, and none failed.

Agents and CI on one machine

Putting both on one server is a security question as much as a capacity one, and the risk runs both ways. A CI job runs whatever the code and its dependencies tell it to, and one bad package could try to break out and take the agents' logins and tokens. An agent can be talked into running a command by something it reads, and an agent with admin rights could tamper with CI's builds, including the ones that ship.

So each side gets walls:

What's left is the kernel. Jobs and agents share one, where a Cloudflare container gets a VM of its own, so a kernel bug could still let a job out. For everyday checks on code I write, I'm fine with that.

Release builds are different, so they never run there. A release job holds the keys that sign my apps, publish my packages and deploy my sites, and what it builds goes to everyone who installs it. Anyone with root on a shared machine could read those keys while the job runs, or swap the build just before it's uploaded. The signature and the provenance record would still check out, because they vouch for the job, not the machine it ran on.

So every job that holds a secret, signs, publishes or deploys asks for a separate label that only Cloudflare serves, one VM per job. If the server is ever broken into, what's exposed is that server, not the apps people install.

While I was at it, I found one more job to run less. My Router's release archives were built on every pull request, though only the builds from main ever ship. Now a pull request builds them only when it changes the dependencies or the workflow. That was the most expensive Linux job I had.

The trade-offs

The result

GitHub billed me nothing for Actions on November 21, 22 or 23. Linux jobs cost a bit over a third of what they did, and Mac jobs cost nothing but a laptop I already had. If GitHub brings back the fee for self-hosted runners it proposed last year, a little of that comes back.

GitHub still has the code, the pull requests and the green checkmarks. It just doesn't get paid by the minute for them.