Leaving GitHub Actions for Cloud Build
I moved CI from GitHub Actions to Google Cloud Build. The reason was simple: Actions billing. Here's how the migration worked and what improved.
4 min read
I moved CI from GitHub Actions to Google Cloud Build. The reason was simple: Actions billing was unpredictable, and I couldn't afford surprises.
Here's how the migration worked, what broke, and what got better.
Why I left Actions#
GitHub Actions is a good product. It's well integrated with GitHub, the syntax is clear, and the ecosystem is large. But it has a billing model that punishes volume, and I run a lot of builds.
Each product in the 70x7 portfolio has its own repo. Each repo runs CI on every push. Each CI run includes lint, typecheck, tests, and a build. Some repos also build Android APKs, which are expensive on Actions because they need a large runner.
The monthly Actions bill was climbing. It wasn't catastrophic, but it was unpredictable. A busy week could double it. A bad merge that triggered a cascade of rebuilds could triple it. I couldn't plan around it, and I couldn't control it.
Google Cloud Build has predictable pricing. You pay for build minutes, and the first 120 build minutes per day are free. For the volume I run, that covers most days. The rest costs a few dollars.
That's enough of a reason to switch.
What the migration looked like#
The first step was rewriting the workflows. Actions uses YAML with jobs and steps. Cloud Build uses YAML with steps and no jobs. The translation was mechanical:
- Each Actions job became a Cloud Build build.
- Each Actions step became a Cloud Build step.
- Secrets moved from GitHub to Secret Manager.
- Artifacts moved from Actions to Cloud Storage.
The second step was setting up triggers. Cloud Build can trigger on a push, a PR, or a tag. I set up triggers for every repo in the portfolio. Each trigger points at a cloudbuild.yaml in the root of the repo.
The third step was fixing what broke. The first few builds failed because the Cloud Build environment is different from Actions. No GITHUB_TOKEN by default. No automatic checkout. No pre-installed tools.
The fixes were small:
- Explicit
git clonein the first step. - Service account with the right permissions to read secrets and write artifacts.
- Docker images with the tools I needed pre-installed, so builds didn't waste minutes installing dependencies every time.
What improved#
Predictable cost. The Cloud Build bill is a few dollars a month. It doesn't spike. It doesn't surprise me. That's worth more than the absolute price.
Faster Android builds. Actions builds Android APKs on a hosted runner. Cloud Build builds them on a machine with enough RAM and a prebuilt Android image. The build went from about 12 minutes to about 6.
Better caching. Cloud Build supports layer caching for Docker images and volume caching for dependencies. Actions supports caching too, but Cloud Build's implementation is faster and more reliable.
Signed artifacts in a private bucket. On Actions, I was uploading the APK as an artifact, downloading it, signing it locally, and uploading it somewhere else. On Cloud Build, the build signs the APK and uploads it directly to a private Cloudflare bucket. No intermediate steps. No manual work.
What didn't improve#
Integration with GitHub. Cloud Build can report status checks to GitHub, but the integration isn't as tight as Actions. You don't get logs inline in the PR. You have to click through to Cloud Build to see what failed. That's not a dealbreaker, but it's a step backward.
Workflow syntax. Cloud Build's YAML is simpler than Actions, but it's also less expressive. You can't define a matrix of builds. You can't reuse steps across builds without copying them. You can't run jobs in parallel without defining separate builds. Those limitations haven't mattered yet, but they might.
The migration checklist#
If you're thinking about moving from Actions to Cloud Build, here's what worked for me:
- Start with one repo. Don't migrate everything at once. Pick one repo, migrate it, let it run for a week, and fix what breaks.
- Set up Secret Manager first. Cloud Build doesn't have a built-in secrets system. You need Secret Manager, and you need a service account with permission to read from it.
- Pre-install tools in a Docker image. Don't install Node, Python, or anything else in every build. Build a Docker image once, push it to Artifact Registry, and reference it in every build.
- Use volume caching for dependencies.
npm installandpip installare expensive. Cache them in a volume and mount the volume in every build. - Keep the logs. Cloud Build deletes logs after 30 days by default. If you need them longer, write them to Cloud Storage.
The takeaway#
The migration took about a week. The first repo took two days. The rest took an hour each. The result is CI that's faster, cheaper, and more predictable.
I didn't leave Actions because it's bad. I left because the billing model didn't work for me. Cloud Build's model does. That's the only reason that mattered.
Related
- Delivery
Shipping with Guardrails
Every agent-written change gets reviewed before it merges. Every deploy passes gates. Every alert opens a specific page. Here's the discipline that makes autonomy safe.
Delivery · Agents · Architecture · Security5 min read
- Engineering
Starship: The Home Mac Fleet
I run my agents on a fleet of Mac minis on 10GbE in my studio. A coordinator, two 64 GB workers, and a Mac Studio that joins in code mode. Here's how it works and why I built it.
Infrastructure · AI · Local LLMs · Architecture4 min read
- Product
One Console for a Portfolio
Running OsoDesk, CNBS, ZoomProp, Cubicall and more from one place. Why I consolidated every product under a single console, and what that makes possible.
Product · Architecture · Delivery4 min read