PR Previews

CI/CD

PR Preview Environments

6 min readUpdated August 2026

Preview apps are a project setting, not a hidden default on every web app. Enable them under Project settings → General → Preview environments, then every matching pull request gets its own apps with a live URL.

Preview apps are named pr-<number>-<source-app> and get a normal *.stackblaze.app host. Closing or merging the PR deletes those apps.

Preview environments are enabled in project settings, a pull request opens on GitHub, and the pr-42-api preview app appears with its own URL.

Preview URL format

PR #42, api

https://pr-42-api.stackblaze.app

App: pr-42-api

Automatic PR comment

stackblazebotBot

Your preview environment is ready!

Preview data

Set Preview data on the same Project settings page. There is no per-app Preview tab.

Empty

Fresh, isolated datastores for the preview apps. Nothing is copied from the source phase.

Snapshot

Clone the source app’s live volumes and databases when the PR opens. Snapshot previews land alongside the source phase.

Seed SQL path (optional)

A path such as .kubero/preview-seed.sql is passed to the preview app as STACKBLAZE_PREVIEW_SEED_PATH. StackBlaze does not run that file as a platform job — your app can apply it on startup if you want.

Under the hood

  • Project setting: previews are configured once on the project, not under each app. Source phase, source app (Off / Auto / pin), Preview data, and Seed SQL path all live on Project settings → General.
  • Same host style as other apps: preview URLs are *.stackblaze.app. There is no separate preview hostname scheme.
  • Teardown: on PR close, the control plane deletes the preview apps. Those apps disappear from the canvas and stop billing.

Step by step

01

Enable previews on the project

Open Project settings → General → Preview environments. Choose Off, Auto — clone every matching app, or pin a single source phase and app. Set Preview data to Empty (fresh datastores) or Snapshot (clone the source app’s live data). Optionally set a Seed SQL path. Click Save preview source.

02

Open a pull request

Open a pull request on the connected GitHub repo. StackBlaze receives the pull_request event and creates preview apps from the source you chose. Apps are named pr-<number>-<source-app>. They set STACKBLAZE_PREVIEW=true plus the PR number, branch, and source name.

03

Open the preview URL

Each preview app gets its own *.stackblaze.app host, the same style as any other web app. Open it from the phase canvas or the Deployment tab. StackBlaze also updates a sticky comment on the PR as the preview builds and becomes ready.

04

Iterate on the branch

Pushes to the PR branch rebuild the preview apps in place. The app name and URL stay the same. Reviewers can keep the same link through the review cycle.

05

Close or merge the PR

When the PR is closed or merged, the control plane deletes the preview apps. Nothing is left running after teardown.