LOOP · The DevOps Codex
Ch 04 · CI/CD Pipelines
Chapter 04 · The Delivery Conveyor

CI/CD Pipelines — where code becomes change in production

A CI/CD pipeline is the automated path from a commit hash to a running deployment. The choices you make about graph shape, runners, caching, and security gates determine your lead time, your blast radius, and whether your developers fear or love Friday afternoons. This chapter maps the 2026 landscape and the patterns that scale.

4.1 · CI vs CD vs CD

TermDefinitionTrigger
Continuous IntegrationEvery commit is built & tested against the mainline.Push / PR.
Continuous DeliveryMainline is always in a deployable state; release is one-click.Manual approval.
Continuous DeploymentEvery passing change is auto-deployed to production.Green pipeline.
The two CDs share an acronym but differ by who pushes the button — a human (Delivery) or the pipeline (Deployment). Both require the same engineering discipline; only the trust threshold differs.

4.2 · The pipeline graph

Definition. A pipeline is a DAG whose nodes are jobs (logical units run on a single executor) grouped into stages (sequential phases) and composed of steps (shell commands or actions). Gates are conditional waits between stages.

commit lint unit tests build integration deploy stg prod gate
  • Fan-out — one upstream job triggers multiple parallel downstream jobs (matrix builds across OS / version).
  • Fan-in — many jobs converge on a single downstream (e.g. deploy waits for all test shards).
  • Gate — environment protection, manual approval, change-window check.

4.3 · The 2026 CI/CD landscape

ToolVendorStrengthsWhen to pick
GitHub ActionsGitHub / MicrosoftMarketplace, OIDC, Reusable Workflows, ARCDefault for GitHub-hosted code.
GitLab CIGitLabAll-in-one DevSecOps, Components, Auto DevOpsSingle platform from VCS to deploy.
Jenkins (LTS)CDF / communityPlugin ecosystem (~1,800), shared librariesLong-standing on-prem, complex legacy.
CircleCICircleCI Inc.Orbs, fast macOS & ARM runnersSaaS speed without GH-Actions coupling.
BuildkiteBuildkiteBYO agents, dynamic pipelinesLarge orgs wanting hybrid control.
Drone / GitnessHarnessContainer-native, lightweightSelf-hosted minimalism.
TektonCDF (CNCF graduated)Kubernetes-native pipelines as CRDsPlatform teams building IDPs on K8s.
Argo WorkflowsCNCFDAG & step workflows on K8sData + ML pipelines on K8s.
DaggerDagger Inc.Pipelines as Python/Go/TS code, BuildKit enginePortable across CI vendors.
ConcourseOSSResource-centric, immutable workersStrict reproducibility shops.
TeamCityJetBrainsKotlin DSL, build chainsJetBrains-heavy stacks.
Bamboo Data CenterAtlassianJira deep integrationExisting Atlassian estates.
Bitbucket PipelinesAtlassianYAML, simpleBitbucket-hosted code.
AWS CodePipeline + CodeBuildAWSNative AWS IAM, Step Functions glueAWS-first workloads.
Azure PipelinesMicrosoftMulti-stage YAML, hosted Win/Mac/LinuxAzure / .NET shops.
GCP Cloud BuildGoogleTight GCR/AR + GKE integrationGCP-first workloads.
Harness CI / CDHarnessAI-assisted, feature flags, GitOpsEnd-to-end commercial DevOps.

4.4 · Pipeline-as-code patterns

Definition. Pipeline-as-code means the pipeline definition lives in the same repository as the source it builds, is versioned with it, and is reviewed via the same PR flow.

PlatformReuse mechanism
GitHub ActionsReusable workflows (workflow_call), composite actions
GitLab CIinclude:, CI/CD Components (2024+)
JenkinsShared Libraries (Groovy)
Azure PipelinesTemplates (YAML), parameters
CircleCIOrbs
TektonTasks, Pipelines, Resolvers (Hub, Git, Cluster)
DaggerReal code in Python / Go / TypeScript — full language semantics
# GitHub Actions — reusable workflow
on:
  workflow_call:
    inputs:
      env: { required: true, type: string }
jobs:
  deploy:
    runs-on: ubuntu-latest
    permissions: { id-token: write, contents: read }  # OIDC
    steps:
      - uses: aws-actions/configure-aws-credentials@v4
        with:
          role-to-assume: arn:aws:iam::1234:role/deploy-${{ inputs.env }}
          aws-region: eu-west-1

4.5 · Runners & executors

ModelExamplesTrade-offs
Vendor-hostedGitHub-hosted, GitLab.com SaaSZero ops, billed per minute, limited customisation.
Self-hosted staticJenkins agents, GitLab Runner on a VMCheap at scale, snowflakes if not rebuilt.
Self-hosted ephemeralActions Runner Controller (ARC), Buildkite Agent Stack, GitLab Runner autoscalerSpawn-per-job on K8s; clean state every run.
GPU runnersCoreWeave, GitHub Larger Runners, RunPodFor ML CI & model evals.
arm64 runnersGitHub arm64 (2024 GA), AWS Graviton, Oracle AmpereCheaper & greener for many workloads.
macOS runnersGitHub macOS, CircleCI, MacStadiumRequired for iOS/macOS notarisation.

4.6 · Caching strategies

  • Dependency cache — Maven local, ~/.cargo, ~/.npm, ~/.pnpm-store, pip wheels.
  • Build cache — Gradle, Bazel, Turborepo remote caches.
  • Compiler cache — ccache, sccache, distcc.
  • Docker layer cache — BuildKit --cache-from/--cache-to, GitHub Actions cache backend, registry cache.
  • Test-result cache — Bazel test caching, Nx affected, Jest --changedSince.
  • Pipeline-vendor caches — Actions cache, GitLab cache, CircleCI cache; mind eviction (typically 7-14 days idle).
Cache poisoning risk. A PR from an untrusted fork must never write to the trusted cache. Scope caches per branch and gate fork-PRs.

4.7 · Pipeline security

  • OIDC federation — short-lived tokens minted per job, exchanged with AWS STS / GCP Workload Identity / Azure Federated Credentials. Eliminates long-lived cloud keys.
  • Least-privilege tokens — GitHub permissions: block scoped per job; default to contents: read.
  • Fork-PR isolation — pull_request_target hazards; require approval for first-time contributors; never expose secrets to pull_request from forks.
  • Pinned actions / images — pin third-party actions by commit SHA; mirror critical actions in-org; Dependabot for action updates.
  • Supply chain — SLSA provenance via actions/attest-build-provenance, Sigstore signing, SBOM upload.
  • Secret hygiene — vendor secret managers (Vault, AWS Secrets Manager, Doppler, Infisical); never echo $SECRET; pipeline log masking.

4.8 · Test strategy in the pipeline

LayerScopeWhere in pipeline
UnitOne function / class, no I/O.Pre-merge, < 2 min target.
IntegrationModule + real DB / queue (Testcontainers).Pre-merge, parallel shards.
ContractPact, Spring Cloud Contract — provider/consumer agreements.Pre-merge.
E2EWhole system via UI / API (Playwright, Cypress).Post-merge / nightly.
SmokeCritical-path checks against a live env.Post-deploy.
Soak / loadLong-running performance (k6, Gatling, Locust).Scheduled / pre-release.
  • Test-impact analysis — only run the tests affected by the diff (Launchable, Testimpact, Bazel test selection, Nx affected).
  • Flaky-test quarantine — auto-detect and isolate (Trunk Flaky Tests, BuildPulse, Datadog CI Visibility).
  • Mutation testing — Stryker, PIT — verifies your tests would actually catch bugs.

4.9 · Pipeline observability

  • DORA dashboards — Sleuth, Faros AI, LinearB, Swarmia, Jellyfish, Code Climate Velocity, Codefresh GitOps Cloud.
  • Native CI insights — GitHub Insights, GitLab Value Stream Analytics.
  • OpenTelemetry CI semantic conventions (draft 2024) — standard spans for pipelines so traces can be ingested by Honeycomb, Tempo, Jaeger.
  • Cost & carbon — Buildkite reports, GH runner cost dashboards, Cloud Carbon Footprint for runner CO₂e.

4.10 · Pipeline anti-patterns

Anti-patternSymptomRemedy
Monorepo full-rebuild on every commit30-min CI for a typo fixAffected-graph (Nx, Bazel, Turbo).
No cachingCold dependency installs every jobVendor cache + remote build cache.
Secrets in logsCred leak in artefactMask, scan logs, rotate, use OIDC instead of static keys.
Snowflake agents"Works only on builder-03"Ephemeral, image-defined runners.
Pipeline configured via web UIDrift between code and executionMove to pipeline-as-code; ban UI edits.
One mega-jobAll-or-nothing 60-min job, no parallelismSplit into jobs; parallelise; fail fast.
Manual gates that always click "approve"Theatre, no signalReplace with automated check or remove.
Cross-references
  • Ch 03 — build caches feeding the pipeline.
  • Ch 05 — what happens after the pipeline (blue/green, canary, rolling).
  • Ch 16 — supply-chain hardening of the pipeline itself.
  • Ch 27 — pipelines as a Platform Engineering product (golden paths).

4.11 · Self-check

Q1 · Which mechanism eliminates long-lived cloud credentials in CI?
Encrypted env vars
OIDC federation to cloud IAM
Storing keys in the repo secret manager
Rotating PATs every 90 days
Q2 · What distinguishes Continuous Delivery from Continuous Deployment?
Delivery skips tests; Deployment runs them.
Delivery only works in monorepos.
Delivery requires a human approval; Deployment ships every green change automatically.
They are the same thing.