0012. Prod environment and approved CD
- Status: accepted
- Date: 2026-10-12
- Issue: #12
Context
pixel-dev is live. Merges to main published GHCR but did not log in to Azure (ADR 0010), because there was no infra/envs/prod and prod secrets must never be the Mini / Pixel Dev Discord token.
Issue 12 asks for a production Container App, a GitHub Environment approval gate, and go-live in a production Discord guild. Dev keeps its own bot and test guild. Pixel is still one guild per bot (DISCORD_GUILD_ID); a second server needs this second application, not a migrate of Pixel Dev.
Prod GitHub OIDC must use the immutable subject repo:pixelbar@1690472/pixel@1402859166:environment:prod (#71) before any azure/login.
Decision
infra/envs/prodcalls the same module asdevwithenvironment = "prod": purge protection on, no purge-on-destroy,azurerm_container_app.managedso apply setscontainer_image. Resource grouppixel-prodalready exists (bootstrap). Own Key Vault (pixel-prod-kv), Files account, Sentry environment, Discord application, and access lists.- Never copy
pixel-dev-kv, the Mini.env, or the Pixel Dev bot token into prod. - Apply is maintainer-only.
just tf-apply prodrefuses unlessPIXEL_APPLY_PROD=1. Coding agents must not apply prod or write prod secrets. CD does not apply Terraform. - Promotion: CD on
mainpublishes the image once, then theprod-cdjob (GitHub Environmentprod) rollspixel-prodto that same digest withaz containerapp update. It does not rebuild. Approvers should treat Environmentprodas the gate; required reviewers and branchmainbelong on that Environment. Superseded by ADR 0013: promotion is the Release workflow, not every merge tomain. just deploy-devstill refuses prod names andPIXEL_ENV=prod. Dev stays local rolls ontopixel-dev.- Register stays a laptop command (
just register prodwith.env.prod). CD does not readpixel-prod-kvDiscord tokens (the GitHub identity is Contributor on the RG, not Key Vault Secrets User).
Consequences
- Discord on prod stays dark until a maintainer applies
infra/envs/prod, fills prod secrets andmembers.yaml, invites the prod bot (scopesbotandapplications.commands), and registers commands. The test guild and Pixel Dev bot are unchanged. - A merge to
mainstill publishes GHCR. Rollingpixel-prodis the Release workflow (ADR 0013). - Re-applying terraform after CD has moved the image will pin
container_imagefrom tfvars; bump that SHA if you apply. - ADR 0010 still describes
just deploy-devand GHCR publish. Its “prod CD off” clause is superseded by this ADR.