05 / Previews

Every change running at its own URL

One line in a job keeps its machine after the job ends and serves the app at its own HTTPS address. The preview lives until its time to live, the branch's next push, or the merge, and then the machine is released first so billing stops.

.github/workflows/preview.yml
- run: bareci preview --port 3000 --ttl 2h -- bun run start

How it works

No separate product

Previews run on the same machines, image and cap as CI. There are no extra runners or secrets to set up.

Private by default

Each preview admits only requests that carry its access token, as a header or once in the URL, which then sets a cookie.

Tested where it runs

Flows run against the preview, so the change is tested as deployed rather than as a dev server. The Gate links it from the pull request.

Later Preview data seeded from a fixture per repository is planned.

At a glance

LifetimeUp to 24 hours; ends on the next push or the merge
AccessPer-preview token
BillingMachine time, plus preview time in whole seconds

Questions

What does a preview cost?

The machine time it uses, plus a preview-hour charge counted in whole seconds. Ending a preview releases the machine first, so billing stops at once.