Skip to content

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:

  1. 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.
  2. Manual force -- When any force* parameter is set to true, the corresponding output variable is set immediately without checkout or dependency installation.

Output Variables

VariableSet when
buildApiAPI or its dependencies changed
buildWebWeb or its dependencies changed
buildSanitySanity or its dependencies changed
buildMatchGatewayMatch Gateway changed
buildApiGatewayAPI Gateway changed
buildGraphqlRouterGraphQL 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

AppTemplateNotes
APIjobs/build-api.yamlDocker build
Webjobs/build-web.yamlDocker build per site x env + CDN upload
Web (Storybook)jobs/build-storybook.yamlpnpm build, archive artifact
Sanityjobs/build-sanity.yamlBuild per environment
Match Gatewayjobs/build-match-gateway.yamlDocker build
API Gatewayjobs/build-api-gateway.yamlDocker build (Traefik)
GraphQL Routerjobs/build-graphql-router.yamlDocker 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 buildForEnvironments parameter (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.