ADR-005 — Separate Pipelines, Released by Hand, One Target per Run
Status: Accepted Date: 2026-12-05 Authors: Engineering & Architecture Team
Context
BRD-005 requires that production receives the release that was tested, that nothing reaches an environment without a person’s recorded decision, that non-production comes first, that the site and its infrastructure can be released independently, and that release work costs nothing when nothing is released.
The repository is private on the GitHub Pro plan. GitHub documents that on Free, Pro and Team plans, required reviewers, wait timers and custom deployment protection rules are available only for public repositories, so a workflow cannot pause for an approval here. Environments, environment secrets and deployment branch restrictions are available.
The site’s HTML holds two values per environment: the media address (images are served by the R2 media bucket on its own assets.<domain> address) and the Analytics tags. So the same commit gives two builds that differ in exactly those values.
Decision Drivers (FRs & NFRs)
- BR-1.1, BR-1.2 / SR-005 SR-F-01 to SR-F-04 — production receives the commit that was tested, checked against the tested build.
- BR-2.1, BR-2.2 / SR-005 SR-F-05 to SR-F-07 — non-production first, a recorded human decision.
- BR-3.1, BR-3.2 / SR-005 SR-F-08 — independent release life cycles for the site and the infrastructure.
- BR-4.1 / SR-005 SR-F-09 — state copies without a person remembering.
- BR-4.2 / SR-005 SR-NF-01 to SR-NF-03 — no idle runs or cost.
Decision — How a release moves from a commit to production
Option 1 — A branch per environment
A push to an environment branch deploys that environment; code moves between branches by merge.
Pros:
- Familiar; no promotion tooling.
Cons:
- A merge creates a new commit, so production runs a build no environment tested.
- Deployment state lives in Git history; a hotfix must be merged into several branches.
Option 2 — Rebuild and re-plan at each gate, with no check
One workflow on main; each environment builds and plans when a person starts it, with nothing tying production to what non-production ran.
Pros:
- Simple: no stored artifacts, no guards.
Cons:
- Nothing proves production received the commit and build non-production tested.
Option 3 — One combined pipeline
One workflow builds the site and applies the infrastructure together for each release.
Pros:
- One run per environment.
Cons:
- A site-only change plans infrastructure, and an infrastructure-only change rebuilds the site.
- Site and infrastructure cannot be released independently.
Option 4 — Build and plan on every push to main, promote the stored result
Each push to main builds both environments and plans both, stores the results, and a person promotes them later.
Pros:
- Production receives a build and plan made before any release decision.
- A broken change is found when it is merged, not when it is released.
Cons:
- Actions minutes are spent on every change, including changes never released.
- A stored plan goes stale when the state changes before the promotion and must be re-planned.
Option 5 — Required reviewers on the GitHub environments
One workflow pauses at each environment until a reviewer approves.
Pros:
- Native GitHub feature, no guard code.
Cons:
- Not enforced on a private repository on the Pro plan; making the repository public would publish the infrastructure code and internal documentation.
Option 6 — One environment-neutral build served by a Worker
The HTML refers to /images/... on the site’s own domain, and a Pages Function reads the environment’s bucket, so one build serves every environment.
Pros:
- One byte-identical build for all environments.
Cons:
- Every image request runs the Function and counts against the free daily Worker request allowance; the R2 custom domain serves images directly at no request cost.
Option 7 — Scheduled scan and state copy
A weekly scan and a daily state copy keep running without a change.
Pros:
- Finds a new vulnerability in unchanged dependencies within a week; catches a forgotten state copy.
Cons:
- Runs and costs when nothing changed; a copy made by the change itself is never forgotten.
Option 8 — Separate infra and app pipelines, released by hand, one target per run, on separate life cycles (CHOSEN)
Nothing runs on a push, a pull request or a schedule. A person starts infra.yml (plan, read it, then apply) and app.yml for one commit of main and one target, non-production first. Each run scans the commit, then plans or builds for that target only. The non-production app run stores its build; the production run builds production from the same commit and must match the stored non-production build except for the environment values. Guards (deploy/scripts/promote-guard.sh) refuse a run not started on main, a commit not on main, and a production run for a commit non-production has not taken. The site and the infrastructure are released on their own schedules: an app run never waits for the infrastructure, and when a site change needs new infrastructure, the person releasing it releases the infrastructure first.
Pros:
- No GitHub Actions minutes are spent on a change until it is released, and none on production until it is released to production.
- Production receives the commit non-production received, with a checked difference limited to the environment values.
- The person who starts the run is recorded as the approver, which works on a private Pro repository.
- The infrastructure plan is always read before it is applied.
- A site change is never held back by an infrastructure change still being tested, and the reverse.
Cons:
- A broken change is found when it is released to non-production, not when the pull request is opened.
- The production build is made at release time and compared, not stored beforehand.
- A release that needs both pipelines is two or three runs per environment, and the person releasing must know the dependency; non-production first catches a missed one before production.
- Guard logic against the GitHub API is extra code (one shared script).
Final Decision
Option 8: two pipelines, infra.yml and app.yml, run only when a person releases a commit of main to one target, non-production first; each run scans, then plans or builds for its own target; production’s build must match the stored non-production build except for the media address and Analytics tags; the site and the infrastructure are released on their own life cycles; state is copied to history after every successful apply; no workflow runs on a push, a pull request or a schedule.
Rejected: branch-per-environment and an unchecked rebuild (the tested release is not provably the released one), the combined pipeline (no independent releases), building on every push (cost for changes never released), required reviewers (not available on this plan), the Worker-served build (per-request cost), and scheduled runs (idle cost).
Accepted cost: a broken change is found at its non-production release; the production build is made at release time and compared with the stored non-production build; the stored non-production build expires after 30 days; promotion guards are maintained as code.