Skip to main content
A preview deploys a GitHub branch or commit as a child of a web server, worker or static website. It separates the deployed resource, not all of its dependencies.

Resource behavior

Public-image web servers do not support GitHub previews. Use the returned endpoint rather than constructing a hostname. Branch previews can redeploy on subsequent branch pushes. A preview is not automatically deleted when a pull request is merged or closed; delete it explicitly.

Review dependencies before creation

Compute previews copy parent compute and container settings. Static previews copy build and output settings. If preview.variables is omitted, Spring Winter copies the parent’s environment set for that resource: Runtime for compute, Build for static websites. An explicit empty array starts with no editable variables. An explicit list supplies the complete initial override. Separate compute does not create a separate database, cache, queue, bucket, credential or external service. Before creation, choose preview-specific dependencies and variable values. A preview worker using a production queue can consume production jobs. A preview application using a production database can change production data. Do not create the preview first and rely on changing these values later.

Create a preview

Use the appropriate parent endpoint:
Send one request with authentication and Content-Type: application/json. This example deliberately avoids inheriting environment variables:
Replace variables with the complete preview-specific set if required. For a commit preview, set source to commit and supply git_sha instead of branch. Read the web server, worker or static website contract before the request. The response includes resource, preview and workflow_run_id. HTTP 201 means accepted, not deployed. Follow the exact returned workflow as described in the agent guide. Check the deployed application where it has a public URL. A running worker needs job-level checks instead.

Inspect and remove previews

The same parent pattern applies to each resource type:
Replace web_servers with workers or static_websites as applicable. Deletion is asynchronous. Wait for its workflow to finish; do not assume that an accepted request has removed the infrastructure. Delete previews before deleting their parent. GitHub branches are not deleted.

Preview environment and observability

Use the preview’s /environment endpoint to inspect or replace its environment set. For compute Runtime values:
PUT replaces the entire editable set in the selected scope. Include all values you intend to retain. Runtime saves can roll compute. Build saves apply on the next build; static websites support Build only. Use a secure local process for secrets; never paste credentials into an agent prompt. Logs and metrics differ by resource type. Compute can report container CPU and memory; static sites have build and delivery observations. Consult the resource reference rather than assuming ECS metrics apply to static sites. See Environment variables for scope, replacement and application behavior.

Cleanup and cost

Previews consume AWS resources until removed. Review costs and delete previews you no longer need. Neither separate infrastructure nor workflow success proves that the application is correct or that its dependencies are isolated.