Stages
The release pipeline consists of five core stages. Each stage is defined as a template in cicd/templates/stages/.
Prepare
Template: stages/prepare.yaml
Determines which applications need to be built by analyzing code changes. Outputs boolean variables consumed by all downstream stages.
Change Detection
Two modes:
- Automatic (default) -- Checks out the repo with full history, runs
pnpx turbo run build --affected --dry-run=json, and parses the output to identify changed packages. - Manual force -- When any
force*parameter is set totrue, the corresponding output variable is set immediately without checkout or dependency installation.
Output Variables
| Variable | Set when |
|---|---|
buildApi | API or its dependencies changed |
buildWeb | Web or its dependencies changed |
buildSanity | Sanity or its dependencies changed |
buildMatchGateway | Match Gateway changed |
buildApiGateway | API Gateway changed |
buildGraphqlRouter | GraphQL Router changed |
These outputs are read by the build, plan_release, and deploy stages to conditionally run jobs.
Code Analysis
Template: stages/code_analysis.yaml
Runs code quality checks. In the release pipeline, all checks are disabled (they were already run in the PR pipeline). In the PR pipeline, all checks are enabled.
See PR Pipeline for details on what each check does.
Jobs
- terraform_validation -- Validates Terraform for each app (parallel with code analysis)
- code_analysis -- Linting, type checking, unit tests, build verification, SonarQube
Build
Template: stages/build.yaml
Creates one stage per application: build_web, build_api, build_sanity, build_match_gateway, build_api_gateway, build_graphql_router. Each stage depends on prepare and runs its app-specific job template.
Per-App Job Templates
| App | Template | Notes |
|---|---|---|
| API | jobs/build-api.yaml | Docker build |
| Web | jobs/build-web.yaml | Docker build per site x env + CDN upload |
| Web (Storybook) | jobs/build-storybook.yaml | pnpm build, archive artifact |
| Sanity | jobs/build-sanity.yaml | Build per environment |
| Match Gateway | jobs/build-match-gateway.yaml | Docker build |
| API Gateway | jobs/build-api-gateway.yaml | Docker build (Traefik) |
| GraphQL Router | jobs/build-graphql-router.yaml | Docker build (Apollo Router) |
Web Build Matrix
The web app produces a build for each combination of site and environment:
- Sites:
feyenoord,de-kuip - Environments: determined by
buildForEnvironmentsparameter (e.g.,[tst])
Each combination requires different environment variables (loaded from Key Vault), resulting in separate Docker images and CDN asset uploads.
Deploy
Template: stages/deploy.yaml
Deploys each application to the target environment. One stage per app.
Each deploy stage depends on prepare, build_*, and (for container apps) plan_release_*. Stages use lockBehavior: sequential to prevent concurrent deployments to the same environment.
See Deployment for the full deployment flow.