Skip to content

Preview environments

Preview environments CI on GitHub Actions

Every pull request waits on a full environment build and deploy.

12m → 3m
Preview ready

Every pull request waits on a full environment build and deploy.

Why it happens

Preview builds do not reuse the layer cache or the base infrastructure between pull requests.

What to change

  1. Share one warm Docker layer cache across all preview builds
  2. Deploy only the changed services rather than the entire stack
  3. Tear down previews automatically on close so cost does not accumulate

Preview environments on runnerhut

yaml
jobs:
preview:
runs-on: runnerhut-8vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4
- uses: runnerhut/setup-buildx@v1
- run: docker buildx build --push -t ghcr.io/acme/api:pr-${{ github.event.number }} .
A working starting point

The only runnerhut-specific line is `runs-on: runnerhut-8vcpu-ubuntu-2404`. Everything else is standard GitHub Actions — the same actions, the same secrets and the same permissions model you use today.

Your next build could be twice as fast, at half the price

Start free. Migrating away is the same one line, and we publish that diff too.