Docs

Preview deploys

Every branch and pull request of a service gets its own copy at its own address, so you can try a change before it's merged. The link shows up where you're already looking.

How it works

  • For a service that deploys from Git, push a branch or open a pull request: Stavo builds it and serves it at /apps/<service>--<branch>/.
  • The link goes on the project board card the branch, pull request or commit mentions (#12, or a branch like feature/12-login), on the pull request as a comment, and as a commit status.
  • Every push updates the same preview. It goes away when the branch is deleted, the pull request is closed or merged, or nobody opens it for a week.
  • A preview gets the service's environment and secrets, with your preview overrides on top. Optionally it gets its own copy of the linked databases, made from their newest backup.
  • Pull requests from forks don't get previews: they would run with your project's secrets.

Set it up

  1. Make a service that deploys from a Git repository (New service > A Git repository). Stavo uses your access token for that host, from Projects > Git & Claude Code.
  2. In the service's Settings, turn on Preview every other branch and pull request.
  3. In its Previews tab, copy the webhook URL and secret, and add the webhook at your Git host:
  • Forgejo or Gitea: Repository > Settings > Webhooks > Add webhook > Forgejo. Content type application/json, events: Push, Pull request, Branch deleted.
  • GitHub: Settings > Webhooks > Add webhook. Content type application/json, events: Pushes, Pull requests, Branch or tag deletion.
  • GitLab: Settings > Webhooks, the secret in Secret token, triggers: Push events, Merge request events.

The same webhook deploys the service itself on every push to its own branch (turn that off with Deploy on every push). Your Git host has to reach your server's address; behind Cloudflare Tunnel that just works.

By hand

Deploy this branch in the Previews tab makes a preview without a webhook. From a terminal, in a checkout of the branch:

sh
git push
stavo deploy --preview
stavo previews ls

Limits (admins)

Admin > Features > Preview deploys turns them on. Admin > Deployed services sets how many previews a service may have (the one nobody opened for the longest makes room) and after how many idle days they go.