ADR-008: CI/CD Pipeline & Delivery Workflow
Context
We require a secure, production-grade DevOps delivery system to automatically build, test, and deploy code changes to staging (dev) and production (prod) domains without ever hardcoding permanent cloud access credentials.
Decision
Deploy using GitHub Actions and Google Cloud Workload Identity Federation (OIDC) keyless exchange.
GitHub Actions dynamically exchanges short-lived OIDC JWT assertions for transient GCP credentials. Staging builds deploy automatically on pushes to `main`, while production releases are triggered exclusively by git tags (`v*`).
Amended (2026-10-16): production is promoted, never rebuilt. A manually run workflow (release.yml) prepares a draft GitHub release; a person publishes it, which creates the `v*` tag. The tag push verifies the cosign signature of the image built for that commit, promotes infrastructure and hosting, and runs smoke tests. Pull requests always run CI; the Terraform plan runs after CI and only when backend files change.
Amended 2026-10-31 (ADR-043): the pool, provider and deployer are declared in a bootstrap stack applied by a human, never by CI. The deployer accepts only pushes to main, manual runs on main, v* tag pushes and the production environment; PR plans, the drift check and the release preview run as a read-only planner account.
Consequences
Benefits:
* Perfect security posture: no static service account JSON keys are saved in GitHub Secrets.
* Clear architectural segregation between dev and prod Cloud Run environments.
* Promotes standard, keyless deployment patterns recommended for modern enterprise governance.
Alternatives considered
1. Storing Service Account JSON keys in GitHub Secrets: Strongly rejected due to token rotation maintenance overhead and exfiltration exposure risks.
2. Manual deployments via local workstation CLI: Rejected to ensure deterministic, auditable release records.