# CI/CD pipeline: stages, gates, a working GitHub Actions workflow and rollback

> A CI/CD pipeline builds, tests, scans and ships every change the same way. See the stages and gates, a GitHub Actions example, rollback and DORA metrics.

- URL: https://computese.com/ci-cd-pipeline/
- Author: Duong Quan Nguyen, CEO, Computese
- Published: 2026-11-29
- Updated: 2026-11-29
- Topics: Custom software, Cloud

## In short
- A CI/CD pipeline is the automated path from commit to a verified release. Continuous integration merges and tests every change, continuous delivery keeps the product releasable on demand, and continuous deployment releases every passing change automatically.
- Order stages by cost: a commit stage that takes minutes, then slower tests and scans. Build the image once, record its digest, and deploy that same image to every environment.
- Treat the pipeline as production. Pin actions to full commit SHAs, start the token at no permissions, replace stored cloud keys with OIDC, and do not check out untrusted pull request code in privileged workflows.
- Choose the rollback before the rollout. Rolling, blue-green, canary and feature-flag releases fail differently, and backward-incompatible schema changes need expand, migrate and contract steps so old and new versions can run side by side.
- Measure delivery with DORA's five metrics, one service at a time and as a prompt for conversation. Turning them into targets invites gaming.

A CI/CD pipeline is the automated path a change takes from commit to a verified release. Each change is built, tested, scanned and packaged the same way, then deployed through gates that stop the line when a check fails, and the release counts only when production runs the build that passed.

Database and infrastructure changes can take the same path ([infrastructure as code](https://computese.com/infrastructure-as-code/)). Product details are as documented in October 2026.

## What is the difference between CI, continuous delivery and continuous deployment?

The three terms nest: delivery builds on integration, and deployment builds on delivery. [Martin Fowler](https://martinfowler.com/articles/continuousIntegration.html) defines continuous integration (CI) as each team member merging into the mainline at least daily, with every integration verified by an automated build, including tests. Testing a feature branch against the mainline without pushing back to it is what he calls semi-integration. A red build comes first: Fowler quotes Kent Beck, "nobody has a higher priority task than fixing the build".

| Practice               | What it means                                                                                                  | Who presses release                 |
| ---------------------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------- |
| Continuous integration | Everyone merges to the mainline at least daily, and each merge gets an automated build and tests               | Nobody; it ends at a verified build |
| Continuous delivery    | The product is releasable to production whenever anyone wishes                                                 | A person, on demand                 |
| Continuous deployment  | The product is released to production automatically whenever it passes all the automated tests in the pipeline | The pipeline                        |

[continuousdelivery.com](https://continuousdelivery.com/implementing/patterns/) describes the deployment pipeline: each change triggers a process that builds deployable packages and runs unit tests and static analysis in a commit stage that takes only a few minutes. Its practices include building packages only once, deploying the same way to every environment, development included, and smoke testing each deployment.

[DORA](https://dora.dev/capabilities/continuous-delivery/) says where to stop: continuous delivery applies to all kinds of software, but continuous deployment cannot be applied to software such as firmware or mobile apps, so start with delivery even if you never plan to deploy every change automatically.

## What stages does a pipeline have, and what gates each one?

A stage answers one question, and a gate stops the line when the answer is no. Order stages by cost so the cheapest checks fail first. Fowler's example is two stages: unit tests with slow services replaced by test doubles, then slower tests on additional machines.

![A conveyor carries grey boxes from a laptop through three arched gates that grow taller toward a server. At the first, smallest gate an orange barrier arm is lowered over a cracked box.](https://computese.com/images/blog/ci-cd-pipeline/fail-fast-gates.dba9e4bc4f-1536.webp)

*The cheapest gate comes first, so failures there never reach the slow stages.*

| Stage    | What runs                                                                                                                                                                                                                                                                                                                                                                                             | The gate                                                                                                                                            |
| -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| Source   | Pull request, review, merge to the mainline                                                                                                                                                                                                                                                                                                                                                           | A required check is red, or stuck "Pending" because a path filter skipped its workflow                                                              |
| Build    | Install from the lockfile, compile                                                                                                                                                                                                                                                                                                                                                                    | A compile error, or a lockfile that disagrees with `package.json` ([`npm ci`](https://docs.npmjs.com/cli/v12/commands/npm-ci/) exits with an error) |
| Test     | Unit, integration and end-to-end tests: many unit tests, far fewer high-level ones (the [test pyramid](https://martinfowler.com/bliki/TestPyramid.html))                                                                                                                                                                                                                                              | Any failing test, because "99.9% green is still red"                                                                                                |
| Security | Secret scanning, static analysis ([SAST](https://github.blog/enterprise-software/secure-software-development/the-architecture-of-sast-tools-an-explainer-for-developers/), for example [CodeQL](https://docs.github.com/en/code-security/concepts/code-scanning/codeql/codeql-code-scanning)), dependency audit, container and IaC scans (for example [Trivy](https://github.com/aquasecurity/trivy)) | A finding at or above the severity you set ([`npm audit`](https://docs.npmjs.com/cli/v12/commands/npm-audit/) exits non-zero)                       |
| Package  | Build the image once, push it, attach an [SBOM](https://computese.com/sbom/) and provenance, sign it (for example with [Sigstore keyless signing](https://docs.sigstore.dev/cosign/signing/overview/)) if others verify it                                                                                                                                                                                                 | A failed push or attestation                                                                                                                        |
| Deploy   | Staging, then production through the same script, behind an approval                                                                                                                                                                                                                                                                                                                                  | No reviewer approves, or the rollout does not finish in time                                                                                        |
| Verify   | Smoke test, running-version check, monitoring                                                                                                                                                                                                                                                                                                                                                         | Production reports a different build than the one tested; roll back                                                                                 |

## What does a working GitHub Actions pipeline look like?

This workflow takes a Node.js service from pull request to a verified production deploy on Amazon EKS, with images in Amazon ECR. It is an illustration: the account ID, role names, cluster, host name and image name are placeholders, and the service must return its commit from `/version`. Actions are pinned to full commit SHAs as of October 2026, the file passes actionlint 1.7.12, and the [Ubuntu 24.04 runner image](https://raw.githubusercontent.com/actions/runner-images/main/images/ubuntu/Ubuntu2404-Readme.md) includes kubectl, the AWS CLI, jq and curl.

```yaml
# .github/workflows/ci-cd.yml
name: ci-cd

on:
  pull_request:
  push:
    branches: [main]

permissions: {}

concurrency:
  group: ci-${{ github.ref }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

env:
  IMAGE: 111122223333.dkr.ecr.us-east-1.amazonaws.com/shop-api

jobs:
  test:
    runs-on: ubuntu-24.04
    timeout-minutes: 15
    permissions:
      contents: read
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
        with:
          node-version-file: .nvmrc
          cache: npm
      - run: npm ci
      - run: npm audit --omit=dev --audit-level=high
      - run: npm test

  image:
    needs: test
    if: github.event_name == 'push'
    runs-on: ubuntu-24.04
    timeout-minutes: 20
    permissions:
      contents: read
      id-token: write # lets the job ask GitHub for an OIDC token
    outputs:
      digest: ${{ steps.build.outputs.digest }}
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - uses: aws-actions/configure-aws-credentials@e1253824e5c10ff9df46874f81ed3ec929e19cfd # v6.3.0
        with:
          role-to-assume: arn:aws:iam::111122223333:role/shop-api-image-push
          aws-region: us-east-1
      - uses: aws-actions/amazon-ecr-login@03f1aad4c6c7ffd436567f42f9384779290529bd # v2.1.7
      - uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
      - id: build
        uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
        with:
          context: .
          push: true
          tags: ${{ env.IMAGE }}:${{ github.sha }}
          build-args: COMMIT_SHA=${{ github.sha }}
          provenance: mode=max
          sbom: true
          cache-from: type=gha
          cache-to: type=gha,mode=max

  deploy:
    needs: image
    runs-on: ubuntu-24.04
    timeout-minutes: 15
    environment: production # required reviewers are set on the environment
    concurrency:
      group: deploy-production
      cancel-in-progress: false
    permissions:
      id-token: write
    steps:
      - uses: aws-actions/configure-aws-credentials@e1253824e5c10ff9df46874f81ed3ec929e19cfd # v6.3.0
        with:
          role-to-assume: arn:aws:iam::111122223333:role/shop-api-deploy
          aws-region: us-east-1
      - run: aws eks update-kubeconfig --name shop-prod
      - env:
          IMAGE_REF: ${{ env.IMAGE }}@${{ needs.image.outputs.digest }}
        run: kubectl set image deployment/shop-api app="$IMAGE_REF"
      - id: rollout
        run: kubectl rollout status deployment/shop-api --timeout=300s
      - id: verify
        run: |
          for _ in $(seq 10); do
            running=$(curl -fsS https://shop.example.com/version | jq -r .commit) || true
            [ "$running" = "$GITHUB_SHA" ] && exit 0
            sleep 6
          done
          echo "production reports '${running:-nothing}', expected $GITHUB_SHA" >&2
          exit 1
      - if: failure() && (steps.rollout.outcome == 'failure' || steps.verify.outcome == 'failure')
        run: kubectl rollout undo deployment/shop-api
```

> [!TIP]
> GitHub is [moving `ubuntu-latest` to Ubuntu 26.04](https://github.com/actions/runner-images/issues/14748) in a rollout that starts on October 19, 2026 and is planned to finish by November 19. This workflow names `ubuntu-24.04`; test on `ubuntu-26.04` before you move.

**Least privilege and concurrency.** `permissions: {}` at the top disables every token permission, and [once you list any permission, GitHub sets the unlisted ones to none](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax), so each job asks only for what it uses: `contents: read` to check out, and `id-token: write` on the two jobs that call AWS, a setting that ["does not grant write access to other resources"](https://docs.github.com/en/actions/reference/security/oidc). The first concurrency group cancels superseded pull request runs but never a running deploy, and the `deploy-production` group stops production deploys from overlapping.

**Build once, deploy the digest.** The `image` job runs only after a merge, pushes the image tagged with the commit SHA and reports its digest, which the `deploy` job rolls out. A tag can be moved, while [a digest is an immutable identifier](https://docs.docker.com/reference/cli/docker/image/pull/), so production runs exactly the image the pipeline built. `provenance: mode=max` and `sbom: true` attach [attestations](https://docs.docker.com/build/ci/github-actions/attestations/) to the pushed image. Max provenance exposes build argument values, so pass secrets as secret mounts, never build arguments.

The release we run for [Minute Notary](https://minutenotary.ca/), an online notary platform with its head office in Ottawa, closes the gap between "pushed" and "live". The image carries its own release ID, the script reads the digest back from the registry after the push, and a deploy counts only when production reports that same ID. Database migrations must succeed before the new server starts, and the previous build's files stay served for a while, so a booking tab opened before the deploy keeps working and reloads once onto the new version. The [case study](https://computese.com/work/minute-notary/) covers the rest of its pipeline.

![A laptop and a gear on the left build one sealed crate with an orange band, which rests on a warehouse shelf. Two dashed arrows lead from the shelf to a staging server and a production server.](https://computese.com/images/blog/ci-cd-pipeline/one-package-many-stages.35693a6364-1536.webp)

*One image, built once and promoted by digest, so every environment runs the same bytes.*

**Approve, roll out, prove.** `environment: production` pauses the `deploy` job until a [required reviewer](https://docs.github.com/en/actions/reference/workflows-and-actions/deployments-and-environments) approves. On GitHub Free, Pro and Team, required reviewers are available only for public repositories, and administrators can bypass protection rules by default, so check both. `kubectl rollout status` waits up to 300 seconds, `verify` polls `/version` until production reports the commit that was built, and a failure in either runs `kubectl rollout undo`, which works because Kubernetes [keeps 10 old ReplicaSets by default](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/).

**Not in the file:** an OIDC identity provider, two IAM roles, an ECR repository, an [EKS access entry](https://docs.aws.amazon.com/eks/latest/userguide/access-entries.html) for the deploy role, a `shop-api` Deployment with an `app` container, the environment's reviewers, and a Dockerfile that serves `COMMIT_SHA` at `/version`.

### The same pipeline in GitLab CI

GitLab uses different keywords. This shortened version keeps a test job and a gated deploy that calls a `deploy.sh` you write:

```yaml
stages: [test, deploy]

test:
  stage: test
  image: node:24
  script:
    - npm ci
    - npm test

deploy-production:
  stage: deploy
  environment: production
  resource_group: production
  id_tokens:
    AWS_ID_TOKEN:
      aud: sts.amazonaws.com
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
      when: manual
  script:
    - ./deploy.sh
```

[`id_tokens`](https://docs.gitlab.com/ci/secrets/id_token_authentication/) with an `aud` replaces `id-token: write`. [`resource_group`](https://docs.gitlab.com/ci/yaml/) limits job concurrency, `when: manual` makes a person start the job, and [deployment approvals](https://docs.gitlab.com/ci/environments/deployment_approvals/) add a formal gate on Premium or Ultimate.

## How do you secure the pipeline itself?

A pipeline can hold the keys to production, and attackers have compromised actions that pipelines run. [Aqua's advisory](https://github.com/aquasecurity/trivy/security/advisories/GHSA-69fq-xp46-6x23) says that on March 19, 2026 an attacker used compromised credentials to publish a malicious Trivy v0.69.4 release and force-push 76 of 77 version tags in trivy-action to credential-stealing malware. In March 2025, [CISA reported](https://www.cisa.gov/news-events/alerts/2025/03/18/supply-chain-compromise-third-party-tj-actionschanged-files-cve-2025-30066-and-reviewdogaction) that tj-actions/changed-files (CVE-2025-30066) was compromised and could expose secrets such as access keys and npm tokens.

**Pin third-party actions to a full commit SHA.** GitHub calls this [currently the only way to use an action as an immutable release](https://docs.github.com/en/actions/reference/security/secure-use), and says to check that the SHA belongs to the action's repository, not a fork. A pin is not a review: Aqua lists "SHA pinning to a safe commit" as unaffected, yet a trivy-action pin from before 2025-04-09 would pull a malicious setup-trivy if invoked during the exposure window. [Dependabot](https://docs.github.com/en/code-security/how-tos/secure-your-supply-chain/secure-your-dependencies/auto-update-actions) opens pull requests for outdated actions and [updates the version comment](https://github.blog/changelog/2022-10-31-dependabot-now-updates-comments-in-github-actions-workflows-referencing-action-versions/) beside a SHA.

**Replace stored cloud keys with OIDC.** The cloud provider issues a short-lived token [valid only for a single job](https://docs.github.com/en/actions/concepts/security/openid-connect), so no long-lived cloud credentials sit in GitHub secrets. On AWS, [the role's trust policy](https://docs.github.com/en/actions/how-tos/secure-your-work/security-harden-deployments/oidc-in-aws) checks the token's `aud` and `sub` claims. Be exact with `sub`: a `StringLike` match on `repo:octo-org/octo-repo:*` lets any branch, pull request merge branch or environment assume the role. For the deploy role, name the environment:

```json
{
  "StringEquals": {
    "token.actions.githubusercontent.com:aud": "sts.amazonaws.com",
    "token.actions.githubusercontent.com:sub": "repo:ORG/REPO:environment:production"
  }
}
```

Repositories created after July 15, 2026, or that [opt in](https://docs.github.com/en/actions/reference/security/oidc), get a `sub` with immutable owner and repository IDs, so copy the format your repository uses. GitHub also [recommends protection rules](https://docs.github.com/en/actions/how-tos/secure-your-work/security-harden-deployments/oidc-in-aws) on any environment an OIDC policy names.

![A pipeline runner on wheels stands beside an empty open safe. A stamping booth passes a plain ticket into a gatehouse window under a cloud, and one short orange key comes back to the runner.](https://computese.com/images/blog/ci-cd-pipeline/key-swap-at-gate.c4e851ee84-1536.webp)

*The runner holds no stored key: it trades an identity token for a credential that expires with the job.*

**Never run untrusted code beside your secrets.** `pull_request_target` and `workflow_run` workflows are privileged, and checking out an untrusted pull request in them [exposes the repository](https://docs.github.com/en/actions/reference/security/secure-use). `actions/checkout` v7, [generally available on June 18, 2026](https://github.blog/changelog/2026-06-18-safer-pull_request_target-defaults-for-github-actions-checkout/), refuses to fetch fork pull request code in those events unless you set `allow-unsafe-pr-checkout`.

> [!WARNING]
> GitHub backported the refusal to supported older majors on [July 20, 2026](https://github.com/actions/checkout/releases) (v1 excluded), but only workflows on a floating major tag such as `@v4` pick it up, not SHA, minor or patch pins. It also does not cover `issue_comment` workflows, `run` steps that fetch a pull request head, or other untrusted repositories.

GitHub's [default policy](https://docs.github.com/en/actions/reference/security/securely-using-pull_request_target) also blocks `pull_request_target` in public repositories without a policy of their own: evaluate mode until enforcement on November 2, 2026 for affected repositories. These controls sit around the code-level checks in our [secure coding checklist](https://computese.com/best-practices-for-secure-coding/).

## Which deployment strategy fits, and how do you roll back?

Choose the rollback before the rollout. [Fowler's note on continuous delivery](https://martinfowler.com/bliki/ContinuousDelivery.html) lists push-button deployments of any version to any environment on demand, so a rollback can be an ordinary deploy of the last good version.

| Strategy                                                    | How it works                                                                               | Rollback                                                                                          | What to watch                                                                                                                                                                 |
| ----------------------------------------------------------- | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Rolling update                                              | Replaces instances gradually; Kubernetes defaults to 25% max unavailable and 25% max surge | `kubectl rollout undo` (`--to-revision=N` for an older one); needs `revisionHistoryLimit` above 0 | Old and new Pods run side by side during the rollout                                                                                                                          |
| Blue-green                                                  | Two production environments, as identical as possible; switch the router to the new one    | Switch the router back                                                                            | Two environments to run; the schema must work with both versions                                                                                                              |
| [Canary](https://martinfowler.com/bliki/CanaryRelease.html) | The new version reaches a small subset first, then widens                                  | Route traffic away from it                                                                        | Several versions run at once; watch the slice's metrics before you widen it                                                                                                   |
| Feature flag                                                | Code ships switched off; a flag releases it                                                | Turn the flag off                                                                                 | [Release toggles](https://martinfowler.com/articles/feature-toggles.html) "should generally not stick around much longer than a week or two"; flags come with a carrying cost |

[Argo Rollouts](https://argo-rollouts.readthedocs.io/en/stable/) says a rolling update "provides no control over the blast radius" in large-scale, high-volume production, and adds blue-green and canary updates, metric analysis and automated rollbacks.

![A cloud feeds a router above a row of five servers. Four servers receive thick grey arrows, and the fifth, the canary, receives a single thin orange arrow.](https://computese.com/images/blog/ci-cd-pipeline/canary-server-row.c4a0d93ce4-1536.webp)

*A canary sends a thin slice of traffic to the new version, so rollback is a routing change.*

[Argo CD](https://argo-cd.readthedocs.io/en/stable/), a declarative GitOps continuous delivery tool for Kubernetes, rolls back to any configuration committed in Git and detects configuration drift automatically. Our [OpenShift vs Kubernetes](https://computese.com/openshift-vs-kubernetes/) guide compares the pipeline and GitOps tooling each gives you.

## How do database migrations fit into a pipeline?

Code rolls back with `kubectl rollout undo`; data does not. Run schema changes as their own step, and make each one work with the version before it and the version after it. The method is [parallel change](https://martinfowler.com/bliki/ParallelChange.html), also called expand and contract: split a backward-incompatible change into expand, migrate and contract phases. [Fowler's blue-green note](https://martinfowler.com/bliki/BlueGreenDeployment.html) gives the order for schemas: first a change that supports both versions of the application, then the application upgrade, and the removal of old support later.

![Three database tables in a row. The left gains an empty dashed column, the middle copies values into it with curved arrows and the new column is orange, and the right has lost the old column.](https://computese.com/images/blog/ci-cd-pipeline/expand-then-contract.d58afdddf2-1536.webp)

*The old column stays until no running version reads it, so releases can be rolled back while the data moves.*

Renaming `customers.name` to `full_name` takes three phases (PostgreSQL syntax):

```sql
-- Expand: additive, so the running version is unaffected
ALTER TABLE customers ADD COLUMN full_name text;
-- deploy the app version that writes both columns

-- Migrate: backfill in batches until no rows match, then enforce
UPDATE customers SET full_name = name WHERE id BETWEEN 1 AND 10000 AND full_name IS NULL;
-- deploy the app version that reads full_name
ALTER TABLE customers ADD CONSTRAINT full_name_set CHECK (full_name IS NOT NULL) NOT VALID;
ALTER TABLE customers VALIDATE CONSTRAINT full_name_set;

-- Contract: only after no running version reads name
ALTER TABLE customers DROP COLUMN name;
```

Locks decide whether a step is safe on a busy table. The [PostgreSQL 18 documentation](https://www.postgresql.org/docs/current/sql-altertable.html) says adding a column with no default or a non-volatile default needs no table rewrite, while a volatile default rewrites the table and its indexes. `NOT VALID` skips the scan, and `VALIDATE CONSTRAINT` takes only a SHARE UPDATE EXCLUSIVE lock, so concurrent updates continue. `SET NOT NULL` scans the table unless a valid CHECK constraint proves there are no nulls, and `ALTER TABLE` forms take an ACCESS EXCLUSIVE lock by default. [`CREATE INDEX CONCURRENTLY`](https://www.postgresql.org/docs/current/sql-createindex.html) builds without blocking writes but cannot run in a transaction block.

The contract step is the one a redeploy cannot undo, so take a restore point first and choose its recovery targets ([RTO vs RPO](https://computese.com/rto-vs-rpo/)).

## How do you keep the pipeline fast and its tests trusted?

Set a time budget and defend it: Fowler calls the Extreme Programming guideline of a ten minute build perfectly within reason for most projects. Then cache what is slow and safe to reuse. [GitHub's cache](https://docs.github.com/en/actions/reference/workflows-and-actions/dependency-caching) removes entries not accessed for over 7 days, limits a repository to 10 GB by default and caps a key at 512 characters. Put the lockfile hash in the key, and a changed lockfile creates a new cache automatically. [`setup-node` with `cache: npm`](https://raw.githubusercontent.com/actions/setup-node/949feb2413d6458794dcd2491c4babbbce0c15c1/README.md) caches npm's global package data, not `node_modules`. Docker marks its [`type=gha` layer cache](https://docs.docker.com/build/cache/backends/gha/) experimental. Keep credentials out of cached paths, because anyone who can open a pull request can read the base branch's caches.

Flaky tests teach people to ignore red builds. [Google reported in 2016](https://testing.googleblog.com/2016/05/flaky-tests-at-google-and-how-we.html) that about 1.5% of its test runs reported a flaky result, almost 16% of its tests showed some flakiness, and about 84% of observed pass-to-fail transitions involved a flaky test, so it was "quite common to ignore legitimate failures in flaky tests". Quarantine removes a test from the critical path but "could easily mask a real race condition". Fowler agrees that [it helps at first](https://martinfowler.com/articles/nonDeterminism.html) but says you still have to fix the tests soon, and suggests a numeric or time limit on quarantine. Our [automation testing trends](https://computese.com/navigating-the-future-unveiling-10-cutting-edge-automation-testing-trends-of-2024/) guide covers the wider test strategy.

## Which numbers show whether the pipeline works?

[DORA's guide](https://dora.dev/guides/dora-metrics/), last updated January 5, 2026, defines five metrics in two groups. Throughput: change lead time (from committed to deployed in production), deployment frequency and failed deployment recovery time. Instability: change fail rate and deployment rework rate, the ratio of deployments that are unplanned but happen because of an incident in production. DORA says speed and stability are not tradeoffs, and that the metrics suit one application or service at a time.

The data for these metrics is spread across several systems. DORA says integrations to multiple systems may not be worth the initial investment and suggests starting with conversations, the DORA Quick Check or a product with pre-built integrations. Its pitfalls include setting metrics as goals (Goodhart's law), relying on one metric, using the industry as a shield and comparing vastly different applications. Our [software development process](https://computese.com/software-and-development/) guide covers delivery beyond the pipeline.

## Which failure modes break a pipeline, and what fixes each?

Each failure mode below leaves a visible symptom. Like any code, a pipeline also collects [technical debt](https://computese.com/technical-debt/).

| Failure mode                   | Symptom and cause                                                                                                   | Fix                                                                                                                |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| Slow pipeline                  | Feedback arrives late; the build is well past ten minutes                                                           | Cheapest checks first, cache by lockfile hash, slow suites later, and a `timeout-minutes` below the default of 360 |
| Flaky tests ignored            | Red builds are assumed flaky, and legitimate failures are ignored                                                   | Quarantine with an owner and a cap, and fix the cause soon                                                         |
| Secrets in logs                | A secret stored as a JSON or YAML blob may not be redacted; an untrusted pull request title is pasted into a script | Single-value secrets or OIDC; pass untrusted input through an intermediate environment variable                    |
| Manual steps in production     | A script run by hand, or an administrator forcing a deploy                                                          | One deploy script for every environment, and no administrator bypass                                               |
| Green pipeline, broken release | Tests pass, but production runs another build or the rollout never finished                                         | The verify step and automatic rollback shown above                                                                 |

The fifth row is the one a green check hides: exit code 0 shows that a command ran, not what production runs.

![A pipeline box sends a crate with a grey striped tag into a server. An arrow leads to a level scale holding that grey tag and the server's own orange tag, and an older crate waits on a shelf below.](https://computese.com/images/blog/ci-cd-pipeline/verify-the-running-build.f1fed5fdab-1536.webp)

*A deploy counts only when production reports the build that was tested; otherwise the older crate goes back in.*

## How do you move from manual deploys to a pipeline?

Finish each stage before the next; a stage is done when its check passes in front of the team.

1. **Baseline one service.** Write down every manual release step, time one release, and note lead time, deployment frequency, recovery time and change fail rate. Done when one person owns the numbers.
2. **Build every pull request.** Install from the lockfile, run the unit tests and make the check required. Done when a red build blocks merging and fixing it comes first.
3. **Merge small and often.** Keep branches to hours, and hide unfinished work behind a flag you remove within a week or two. Done when branches rarely outlive a working day.
4. **Build once, deploy by digest.** One image per merge, tagged with the commit SHA and deployed to staging by the script production will use. Done when staging runs only images the pipeline built.
5. **Gate and verify production.** An environment with reviewers, OIDC roles, the verify and rollback steps, pinned actions and permissions that start at none. Done when you have rehearsed a rollback on purpose.
6. **Add security checks one at a time.** Secret scanning, dependency audit, static analysis and a container scan, reporting first and then blocking at a severity threshold. Done when each gate has an owner and a threshold.
7. **Raise the ambition last.** Add canary or blue-green releases where one bad release is expensive, and decide about continuous deployment at the end. If a legacy system blocks daily releases, the [strangler fig pattern](https://computese.com/strangler-fig-pattern/) replaces it piece by piece.

Computese builds this chain in its [custom software development](https://computese.com/services/custom-software-development/) work, where the same gates run on every change and a release counts only when production reports the build that was tested. In [cloud transformation](https://computese.com/services/cloud-transformation/) the deliver lane's CI builds, tests and scans, signs each image and produces an SBOM, and Argo CD syncs to the cluster and detects drift. The chain can run without internet access: in [a bank's move from OpenShift 3 to 4](https://computese.com/work/banking-platform-migration/), Jenkins, Argo CD, Kaniko, Nexus, SonarQube and Trivy ran inside an air gap.

## Key terms
- **Continuous integration (CI)**: A practice in which each team member merges their changes into the shared mainline at least daily, and every merge is verified by an automated build that includes tests.
- **Continuous delivery**: Keeping a product releasable to production whenever anyone wishes, by automating the build, test and deployment steps. The team may still choose when to release.
- **Continuous deployment**: Releasing every change to production automatically once it passes all the automated tests in the pipeline. It requires continuous delivery first and cannot be applied to software such as firmware or mobile apps.
- **Commit stage**: The first and fastest stage of a deployment pipeline. It builds deployable packages and runs unit tests and static analysis in a few minutes, and a failure is fixed before more work is checked in.
- **Image digest**: The sha256 hash that identifies one exact container image. A tag can be moved, but a digest is an immutable identifier, so deploying by digest runs exactly what was tested.
- **OIDC token**: A token that GitHub issues to a job as proof of the workflow's identity. A cloud provider that trusts GitHub exchanges it for temporary credentials, so no long-lived cloud key is stored as a secret.
- **Canary release**: A release that reaches a small subset of users or infrastructure first and widens as the new version proves itself. Rollback means routing traffic away from it.
- **Blue-green deployment**: Two production environments kept as identical as possible, with one live. The new release is tested in the idle one, the router switches to it, and switching back is the rollback.
- **Expand and contract**: Also called parallel change. A backward-incompatible change is split into expand, migrate and contract phases so old and new versions work throughout. Most database refactorings follow the same pattern.
- **Flaky test**: A test that both passes and fails on the same code, for reasons such as concurrency or non-deterministic behaviour. Flaky results make it common to ignore legitimate failures.

## Common questions

### What is a CI/CD pipeline?

A CI/CD pipeline is the automated process that takes a change from commit to production. It builds the code, runs tests and security checks, packages the result once and deploys it through gates. A good one ends by checking that production runs the build that was tested.

### What is the difference between continuous delivery and continuous deployment?

With continuous delivery the product is always releasable, and a person decides when to release it. With continuous deployment every change that passes all the automated tests is released to production automatically. DORA advises starting with continuous delivery even if you never plan to deploy every change automatically.

### What are the stages of a CI/CD pipeline?

A pipeline can be organized as source, build, test, security, package, deploy and verify stages. The cheapest and fastest checks run first, such as a lockfile install and unit tests, then slower integration tests, scans and the image build. Production comes last, behind an approval, and ends with a check that it runs the tested build.

### How long should a CI build take?

Martin Fowler calls the Extreme Programming guideline of a ten minute build perfectly within reason for most projects. The continuous delivery pattern asks for a first commit stage that takes only a few minutes, with slower tests in later stages.

### Should I pin GitHub Actions to a commit SHA?

For third-party actions, yes. GitHub says pinning to a full-length commit SHA is currently the only way to use an action as an immutable release, and that you should verify the SHA comes from the action's own repository and not a fork. A pin is not a review, so read the updates that Dependabot proposes.

### How do I deploy to AWS from GitHub Actions without storing access keys?

Use OpenID Connect. The job asks GitHub for an OIDC token (it needs the id-token: write permission), and the aws-actions/configure-aws-credentials action trades it for temporary AWS credentials through a role whose trust policy checks the token's aud and sub claims. GitHub says the credential is only valid for a single job.

### What are the DORA metrics?

In DORA's guide, last updated on January 5, 2026, there are five. Change lead time, deployment frequency and failed deployment recovery time measure throughput, and change fail rate and deployment rework rate measure instability. DORA says they suit one application or service at a time and warns against setting them as goals.

## Sources
1. [Continuous Integration](https://martinfowler.com/articles/continuousIntegration.html), martinfowler.com
2. [Continuous Delivery](https://martinfowler.com/bliki/ContinuousDelivery.html), martinfowler.com
3. [Patterns for implementing continuous delivery](https://continuousdelivery.com/implementing/patterns/), continuousdelivery.com
4. [Capabilities: Continuous delivery](https://dora.dev/capabilities/continuous-delivery/), DORA
5. [DORA's software delivery performance metrics](https://dora.dev/guides/dora-metrics/), DORA
6. [Test Pyramid](https://martinfowler.com/bliki/TestPyramid.html), martinfowler.com
7. [Code scanning with CodeQL](https://docs.github.com/en/code-security/concepts/code-scanning/codeql/codeql-code-scanning), GitHub Docs
8. [The architecture of SAST tools: An explainer for developers](https://github.blog/enterprise-software/secure-software-development/the-architecture-of-sast-tools-an-explainer-for-developers/), The GitHub Blog
9. [Trivy: a security scanner](https://github.com/aquasecurity/trivy), Aqua Security (GitHub)
10. [Workflow syntax for GitHub Actions](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax), GitHub Docs
11. [Deployments and environments](https://docs.github.com/en/actions/reference/workflows-and-actions/deployments-and-environments), GitHub Docs
12. [Secure use reference](https://docs.github.com/en/actions/reference/security/secure-use), GitHub Docs
13. [OpenID Connect](https://docs.github.com/en/actions/concepts/security/openid-connect), GitHub Docs
14. [OpenID Connect reference](https://docs.github.com/en/actions/reference/security/oidc), GitHub Docs
15. [Configuring OpenID Connect in Amazon Web Services](https://docs.github.com/en/actions/how-tos/secure-your-work/security-harden-deployments/oidc-in-aws), GitHub Docs
16. [Safer pull_request_target defaults for GitHub Actions checkout](https://github.blog/changelog/2026-06-18-safer-pull_request_target-defaults-for-github-actions-checkout/), GitHub Changelog
17. [Releases: actions/checkout](https://github.com/actions/checkout/releases), GitHub (actions/checkout)
18. [Securely using pull_request_target](https://docs.github.com/en/actions/reference/security/securely-using-pull_request_target), GitHub Docs
19. [Dependency caching reference](https://docs.github.com/en/actions/reference/workflows-and-actions/dependency-caching), GitHub Docs
20. [Keeping your actions up to date with Dependabot](https://docs.github.com/en/code-security/how-tos/secure-your-supply-chain/secure-your-dependencies/auto-update-actions), GitHub Docs
21. [Dependabot now updates comments in GitHub Actions workflows referencing action versions](https://github.blog/changelog/2022-10-31-dependabot-now-updates-comments-in-github-actions-workflows-referencing-action-versions/), GitHub Changelog
22. [Trivy ecosystem supply chain temporarily compromised (GHSA-69fq-xp46-6x23)](https://github.com/aquasecurity/trivy/security/advisories/GHSA-69fq-xp46-6x23), Aqua Security (GitHub Security Advisories)
23. [Supply Chain Compromise of Third-Party tj-actions/changed-files (CVE-2025-30066) and reviewdog/action-setup@v1 (CVE-2025-30154)](https://www.cisa.gov/news-events/alerts/2025/03/18/supply-chain-compromise-third-party-tj-actionschanged-files-cve-2025-30066-and-reviewdogaction), CISA
24. [[Ubuntu] ubuntu-latest label will use Ubuntu 26.04 in November 2026 (issue 14748)](https://github.com/actions/runner-images/issues/14748), GitHub (actions/runner-images)
25. [Ubuntu 24.04 runner image: included software](https://raw.githubusercontent.com/actions/runner-images/main/images/ubuntu/Ubuntu2404-Readme.md), GitHub (actions/runner-images)
26. [Using actions/setup-node: caching global packages data](https://raw.githubusercontent.com/actions/setup-node/949feb2413d6458794dcd2491c4babbbce0c15c1/README.md), GitHub (actions/setup-node)
27. [npm ci](https://docs.npmjs.com/cli/v12/commands/npm-ci/), npm Docs
28. [npm audit](https://docs.npmjs.com/cli/v12/commands/npm-audit/), npm Docs
29. [GitHub Actions cache](https://docs.docker.com/build/cache/backends/gha/), Docker Docs
30. [Add SBOM and provenance attestations with GitHub Actions](https://docs.docker.com/build/ci/github-actions/attestations/), Docker Docs
31. [docker image pull: pull an image by digest](https://docs.docker.com/reference/cli/docker/image/pull/), Docker Docs
32. [Signing overview (keyless signing)](https://docs.sigstore.dev/cosign/signing/overview/), Sigstore
33. [Grant IAM users access to Kubernetes with EKS access entries](https://docs.aws.amazon.com/eks/latest/userguide/access-entries.html), Amazon Web Services
34. [Deployments](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/), Kubernetes
35. [Blue Green Deployment](https://martinfowler.com/bliki/BlueGreenDeployment.html), martinfowler.com
36. [Canary Release](https://martinfowler.com/bliki/CanaryRelease.html), martinfowler.com
37. [Parallel Change](https://martinfowler.com/bliki/ParallelChange.html), martinfowler.com
38. [Feature Toggles (aka Feature Flags)](https://martinfowler.com/articles/feature-toggles.html), martinfowler.com
39. [Argo CD documentation](https://argo-cd.readthedocs.io/en/stable/), Argo Project
40. [Argo Rollouts documentation](https://argo-rollouts.readthedocs.io/en/stable/), Argo Project
41. [ALTER TABLE (PostgreSQL 18)](https://www.postgresql.org/docs/current/sql-altertable.html), PostgreSQL Documentation
42. [CREATE INDEX (PostgreSQL 18)](https://www.postgresql.org/docs/current/sql-createindex.html), PostgreSQL Documentation
43. [Flaky Tests at Google and How We Mitigate Them](https://testing.googleblog.com/2016/05/flaky-tests-at-google-and-how-we.html), Google Testing Blog
44. [Eradicating Non-Determinism in Tests](https://martinfowler.com/articles/nonDeterminism.html), martinfowler.com
45. [CI/CD YAML syntax reference](https://docs.gitlab.com/ci/yaml/), GitLab Docs
46. [OpenID Connect (OIDC) authentication using ID tokens](https://docs.gitlab.com/ci/secrets/id_token_authentication/), GitLab Docs
47. [Deployment approvals](https://docs.gitlab.com/ci/environments/deployment_approvals/), GitLab Docs
