production, deploy-preview (a pull request preview) or branch-deploy (a branch deploy). You can override env vars and static build settings for each, and for a named branch or branch pattern, without touching the app’s own defaults.
What you can set
Context names:
deploy-preview, branch-deploy, and branch:<pattern> where the pattern is an exact branch name or a glob such as release/*. production is the app’s own settings, so it takes no overrides.
Resolution order
For every value, the first match wins, highest first:- Branch env override (
apps branch-env), exact pattern before glob. - Branch context (
branch:<pattern>), exact pattern before glob. - The deploy’s context (
deploy-previeworbranch-deploy). - The older app-wide preview env override (
apps preview-env), previews only. - The app default.
apps pr-env) still wins over all of these for that pull request. Existing branch env overrides and preview env overrides keep working unchanged.
Set contexts
- UI
- CLI
- API
- app.yaml
Open the app, then Previews, and use Deploy contexts. Pick a context, fill in env vars (one
KEY=VALUE per line) and any build settings, then save. Settings you leave empty inherit.See the effective config
The Effective config for this deploy view shows, for a chosen context and branch, every env var and build setting with where its value came from. Secrets, and values whose names look sensitive, stay masked. It appears under Previews and on each deploy’s build tab.What this does not do
- Production deploys use the app’s own settings only.
- Context env vars are stored as plain values, so keep secrets in branch env overrides or app secrets.
- Build overrides only change what a preview or branch deploy builds. They never touch the production build.