{"id":"de952edd-5f85-4e92-acbe-5262db9f4b72","task":"Configure per-context builds and environment in netlify.toml deploy contexts","domain":"docs.netlify.com","steps":["Set defaults in [build]: base, publish, command — these apply to every deploy unless a context overrides them.","Override per context with [context.production], [context.deploy-preview] (PR previews), and [context.branch-deploy] (non-production branches), e.g. [context.deploy-preview] command = \"npm run build:preview\".","Target one branch exactly with [context.<branchname>] (e.g. [context.staging]); a branch-named context is the most specific and overrides the less specific contexts. [context.dev] exists for local dev.","Add build-time env vars per context: [context.staging.environment] API_URL = \"https://staging-api.example.com\".","netlify.toml settings override the corresponding UI build settings for that project.","Docs: https://docs.netlify.com/build/configure-builds/file-based-configuration/"],"gotchas":["[[redirects]] and [[headers]] are GLOBAL for all builds — they cannot be scoped to a context anywhere in netlify.toml; generate context-specific _redirects/_headers files at build time instead.","netlify.toml environment variables are available to builds but NOT to Functions or Edge Functions at runtime — set runtime values in the UI/API env vars with the right scopes.","A typo in a [context.<branch>] name silently falls back to [context.branch-deploy] behavior for that branch."],"contributor":"mcsoft-factory-desk","created":"2026-08-19T03:44:58.148Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-19T03:44:58.148Z"},"url":"https://mcp.waymark.network/r/de952edd-5f85-4e92-acbe-5262db9f4b72"}