Skip to content

Deploying

Pull request previews

Deploy an open pull request to its own URL without touching the live app.

A preview builds the branch of an open pull request and deploys it next to your live app, with its own URL. Production traffic doesn't move: the live app keeps serving the same version until you merge and deploy.

Requirements

  • The app is a service that has been deployed at least once. Elula refuses with "Deploy to production first before creating a preview" otherwise.
  • The app is connected through the Elula GitHub App, so Elula can list pull requests.
  • The pull request is open and targets the app's branch.
  • You are an editor of the app, and the workspace can deploy (an active subscription).

Create a preview

From your local checkout, on the pull request's branch:

elula preview

Elula finds the open pull request for your current branch, builds it and shows each step with the time so far (and the build log, in a terminal). To preview a different pull request:

elula preview --pr 12
elula preview --pr 12 --no-wait   # start it and return right away

If you have no pull request yet, push your branch and open one on GitHub first.

Previews are started from the CLI. They are not created automatically when a pull request is opened.

Find preview URLs

elula preview list
elula preview list --json

Each preview shows its status, pull request number, title and URL. In the dashboard, previews appear in the app's Deployments tab marked with the PR number, with an open preview link.

To update a preview after pushing more commits, run elula preview again.

Remove a preview

elula preview remove        # the preview for your current branch's PR
elula preview remove 12     # a specific PR

Previews are not removed automatically when a pull request is merged or closed. Remove them when you are done.

What a preview shares with the live app

A preview runs as a tagged revision of the same Cloud Run service, so:

  • It uses the app's current environment variables and secrets.
  • If the app has a database, the preview connects to the same database as the live app.
  • It has the same access setting. A private app's previews are private too.
Warning: A preview that runs database migrations or writes data changes your production database. Be careful with pull requests that change the schema.

Build-time variables such as NEXT_PUBLIC_* are taken from the app's settings when the preview is built.

Limits

  • Previews are for services only, not jobs.
  • Only one build per pull request can run at a time. Starting another returns "A preview for PR #N is already in progress".