Skip to content

environments

View as Markdown

Environments by name. If omitted, a single production environment deploys from the repository’s default branch.

  • Type: map of names to object
  • Since: manifest v1
environments:
production:
branch: main
protection:
require_approval: true
staging:
branch: develop

An environment. Each has its own private network, variables, secrets and databases.

Field Type What it does
kind production, staging, preview, development Defaults from the name (production, staging, preview), otherwise development.
branch string Git branch that deploys to this environment on push.
pull_requests boolean Create a short-lived copy of this environment for every pull request.
ttl duration How long a preview environment lives after its last push.
spend_cap money Monthly cap for this environment (for previews, per preview).
databases new, branch, branch-masked or map of names to new, branch, branch-masked How databases are provided in this environment.
protection object Guard rails for an environment.
sleep_when_idle boolean Default sleep_when_idle for services in this environment.
variables env Shared variables for this environment, overriding top-level variables.
services map of names to object Per-service overrides for this environment (deep-merged over the base service).