00003 — App Pipeline

By Engineering Team•October 12, 2026•3 min read

Implements SR-007. When a release runs, the guards and the order between environments are in 00006 — GitHub Workflow Architecture; this page covers only what app.yml does. The request path is in 00001.


1. Flow

App pipeline: a person runs the workflow on main with a SHA and target; if the guards pass the commit is scanned and built for the target; a nonprod build is stored for 30 days with the checksums of the images it links, a prod build is compared with the stored nonprod build; the images the build links are copied inside R2 into the target media bucket; the build is deployed to the target Pages project and the promotion recorded


2. Steps

After the guard and the scan, the work runs as three jobs in the target’s GitHub environment: build (build, package and, for prod, compare), media (copy the images) and deploy (publish and record). They pass the build on as an artifact of the run, checked against its checksum before use, so a failed job can be re-run on its own without building again.

Step What happens Requirements
Guard See 00006, guards. SR-005 SR-F-07, SR-F-08
Scan Trivy scans the commit for vulnerable dependencies and secrets; a high or critical finding stops the run. SR-007 SR-F-02, SR-004
Build In a job bound to the target’s GitHub environment: the media address and the environment’s own Analytics measurement ID are loaded from the target’s vault through its read-only service account; npm ci and npm run build on a pinned Node version. npm run build also writes the Content-Security-Policy into dist/_headers. The job fails if dist/images exists: images live in the media bucket. The publishing token is loaded only after the build, right before the deploy step. SR-007 SR-F-03, SR-F-07
Store (nonprod) The build, its SHA256SUMS, its media origin and the checksums of the images it links are stored as site-nonprod-<sha> for 30 days. SR-005 SR-F-02
Compare (prod) The stored nonprod build of the same commit is downloaded and checked; scripts/compare-builds.sh fails the run unless the two builds differ only in the media origin, the Analytics tags and the script hashes. SR-005 SR-F-03
Copy images The media copy key pair is loaded from the target’s vault; scripts/promote-media.sh lists the images the build links (prod: the stored nonprod build), checks each in the non-production media bucket, and copies it inside R2 into the target’s media bucket. Nonprod copies each onto itself, which restarts its expiry, and stores the images’ checksums with the build; prod checks each against them. The key pair is cleared after the step. SR-005 SR-F-10, SR-NF-08
Deploy Wrangler, pinned, uploads dist/ to the target’s Pages project as its main deployment, with that environment’s Pages-only publishing token. SR-007 SR-F-04
Record The run summary names the commit, the build digest and the person; the marker promoted-app-<target>-<sha> is uploaded last. SR-005 SR-F-06

The workflow publishes content and the images that content links. It cannot change DNS, firewall, bucket settings or any other infrastructure: its publishing token can deploy Pages only, and its media copy key pair can only read objects in the non-production media bucket and write objects in its own environment’s. One release per environment runs at a time, including a re-run of a failed job.