On this page
A good CI/CD pipeline turns "deploying is scary" into "deploying is boring" — and boring is exactly what you want. Here's how our DevOps & automation team designs pipelines that scale from a single service to hundreds without becoming a bottleneck or a security liability.
Pick a platform, then stop debating it
The choice of CI tool matters less than the discipline around it. Choose the one that sits closest to your code and your team's skills, and spend the saved time on the gates below.
| Platform | Fits when | Watch out for |
|---|---|---|
| GitHub Actions | Code lives on GitHub and you want OIDC to the major clouds and a large catalogue of actions | Third-party actions are code that runs with your secrets; pin and review them |
| GitLab CI/CD | You want source, CI, registry and scanning in one product, hosted or self-managed | Runner fleet upkeep if you self-host |
| Jenkins | A large existing estate, unusual build hardware or strict on-premises rules | Plugin sprawl, patching and controller upkeep are all yours |
| Azure DevOps Pipelines | Teams already using Azure Boards and Repos | Mixing it with GitHub repos splits permissions and audit trails |
| Cloud-native (AWS CodePipeline, Google Cloud Build) | Single-cloud teams who want pipelines governed by the same IAM as everything else | Harder to move if you change clouds |
| Argo CD or Flux | Deploying to Kubernetes with GitOps | They replace the deploy step only; you still need CI |
For most teams on GitHub, Actions for CI plus Argo CD or Flux for Kubernetes delivery is a sensible default. If you do not run Kubernetes, a deploy job in the same workflow is fine.
Start with the contract: what "done" means
Every change should pass the same gates before it can merge:
- A reproducible build (pinned toolchains and dependency lockfiles)
- Unit tests and fast integration tests
- Linting and static analysis (SAST)
- Dependency (SCA) and secret scanning
- Infrastructure-as-code checks for any Terraform or Kubernetes manifests
Define these once — as reusable workflow templates or a shared pipeline library — and make them non-negotiable through branch protection. Consistency is what lets you trust the pipeline, and shared templates are the first building block of a proper internal developer platform.
A reference pipeline, stage by stage
On every pull request:
- Check out the code and restore dependency and build caches.
- Build with locked dependencies and a pinned toolchain.
- Run unit tests and fast integration tests against throwaway containers.
- Run linting, SAST, dependency scanning and secret scanning in parallel.
- Run
terraform planand policy checks on the plan, or validate Kubernetes manifests. - Optionally, deploy a preview environment with a time-to-live label.
On merge to the main branch:
- Build the container image once and push it, recording its digest.
- Generate an SBOM, sign the image and attach build provenance.
- Scan the image and block on critical vulnerabilities that have a fix.
- Update the staging environment (a GitOps commit, or a deploy job) and run smoke and end-to-end tests.
- Promote the same digest to production behind a canary, watch the SLOs, and roll back automatically if they burn.
Keep feedback fast
Developers stop trusting pipelines that take forty minutes. Cache dependencies and build layers, run independent jobs in parallel, split slow test suites, and only run expensive suites (end-to-end, performance) where they add signal — for example on merge to main rather than on every push. Track pipeline duration and flaky-test rate as first-class metrics; a flaky test that everyone re-runs is a gate nobody believes in.
Our working target, not an industry standard: pull-request feedback in under ten minutes, and merge-to-production in under an hour for a typical service. Past that, people switch tasks while they wait and batch changes together, which makes every deploy riskier. Build minutes cost money too. Heavy builds can run on self-hosted runners on spot capacity, as we describe in Kubernetes cost control, provided those runners are isolated per job.
Everything as code
Pipeline definitions, infrastructure and configuration all belong in version control. Infrastructure-as-code (Terraform or OpenTofu) plus GitOps (Argo CD or Flux for Kubernetes) means the repository is the single source of truth, changes are reviewed like any other code, drift is detected automatically, and rollback is a git revert away.
Add policy as code where the stakes are high: checks on Terraform plans (for example with OPA and Conftest) that reject public buckets or untagged resources, and admission policies in the cluster (Kyverno or Gatekeeper) that reject privileged pods or unsigned images. A rule enforced by the pipeline does not depend on a reviewer noticing.
Build once, promote the artifact
Build a single immutable artifact — usually a container image referenced by its digest, not a mutable tag — and promote that exact artifact through dev, staging and production. Never rebuild per environment; that reintroduces the "works on my machine" class of bugs at the worst possible moment. Environment differences belong in configuration, injected at deploy time.
In practice that means deploy manifests reference registry.example.com/api@sha256:… rather than api:latest or even api:1.4.2. Tags can be moved; a digest cannot. Keep the human-readable tag for people and the digest for machines.
Progressive delivery
Big-bang deploys are risky. Canary and blue-green strategies release to a small slice of traffic first, watch your service-level objectives, and roll back automatically if the error budget starts to burn. This is where delivery meets SRE & observability: automated rollback is only as good as the health signals behind it.
- Automated rollback tied to real metrics (error rate, latency), not just "pod is running"
- Feature flags to decouple deploy from release
- Backward-compatible database migrations (expand, migrate, then contract)
Worked example: renaming a column without downtime (illustrative)
A team wants to rename customer_name to full_name. Doing it in one release breaks whichever version of the app is still running during the rollout. Instead:
- Release 1, expand. Add
full_name, write to both columns, and backfill old rows in batches. - Release 2, migrate. Read from
full_name, keep writing both, and confirm in monitoring that nothing reads the old column. - Release 3, contract. Stop writing
customer_name, then drop it once you are past the window in which you might roll back to release 2.
Each release is safe to roll back on its own, which is the whole point. Tools such as Argo Rollouts or Flagger can then shift traffic in steps (for example 5%, 25%, 50%, then all of it) with an automated metrics check at each step.
Secure the pipeline itself
The pipeline holds the keys to production — treat it as production.
- No long-lived cloud keys in CI. Use OIDC federation (for example GitHub Actions to AWS IAM roles, Azure workload identity or GCP Workload Identity Federation) so each job gets short-lived, scoped credentials.
- Pin third-party actions and plugins to a commit SHA and review updates.
- Sign artifacts and record provenance — Sigstore/cosign signatures and SLSA-style provenance let your cluster verify that what runs is what you built.
- Scan images before promotion and block on critical, fixable vulnerabilities.
- Keep an audit trail of who approved and deployed what, and when — auditors for ISO 27001 and SOC 2 will ask for it.
- Default the workflow token to read-only and grant write scopes per job, only where a job needs them.
- Protect production with environments that require a reviewer and only accept deploys from the main branch.
- Never run untrusted pull-request code with secrets. GitHub's guidance on
pull_request_targetexplains why checking out and executing a fork's code in that trigger has led to supply-chain compromises.
OIDC from GitHub Actions to AWS, in practice
The job asks GitHub for a signed token, and AWS exchanges it for temporary credentials if the token's claims match the role's trust policy. GitHub's OIDC documentation covers AWS, Azure, Google Cloud and HashiCorp Vault. A minimal deploy job:
permissions:
id-token: write # lets the job request an OIDC token
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@<full-commit-sha>
- uses: aws-actions/configure-aws-credentials@<full-commit-sha>
with:
role-to-assume: arn:aws:iam::123456789012:role/deploy-prod
aws-region: ap-south-1
On the AWS side, register https://token.actions.githubusercontent.com as an identity provider and give the role a trust policy that checks two claims: token.actions.githubusercontent.com:aud equals sts.amazonaws.com, and token.actions.githubusercontent.com:sub equals repo:your-org/your-repo:environment:production. Scoping the subject to an environment, not just the repository, means a workflow on a feature branch cannot assume the production role. The most common mistake is a wildcard subject that trusts every repository in the organisation.
Pinning: why tags are not enough
On 14 and 15 March 2025, the tags of the widely used tj-actions/changed-files action were repointed to a malicious commit that exposed secrets in workflow logs (CVE-2025-30066, which CISA added to its Known Exploited Vulnerabilities catalogue on 18 March 2025). Workflows pinned to a full commit SHA were not affected. Since 15 August 2025, GitHub's allowed-actions policy can enforce SHA pinning and block specific actions across an organisation. Turn it on, and let a dependency bot propose pinned updates so pinning does not mean never updating.
SLSA levels and signing
SLSA is the framework most teams use to describe build integrity. Version 1.2, announced on 24 November 2025 and current as of October 2026, adds a Source track alongside the Build track. The Build track levels:
| Level | What it requires | A practical route on GitHub |
|---|---|---|
| Build L0 | Nothing | Builds on laptops or ad-hoc scripts |
| Build L1 | Provenance showing how the package was built | Generate provenance in CI for every release |
| Build L2 | Signed provenance generated by a hosted build platform | GitHub artifact attestations, which provide Build L2 by default |
| Build L3 | A hardened build platform that prevents tampering during the build | Attestations generated from reusable workflows that isolate the build |
GitHub artifact attestations sign with Sigstore: public repositories use the Sigstore public-good instance, private repositories use GitHub's own. Outside GitHub, cosign (version 3.x as of October 2026) signs in the Sigstore bundle format by default. Signing only helps if something checks it, so add an admission policy that rejects unsigned images or images whose provenance points at the wrong repository. Build L2 is a realistic first target for most teams. Aim for L3 on anything customers install.
Pipelines are also part of your attack surface. Our VAPT services can include CI/CD configuration in scope — over-privileged runners, exposed secrets and unprotected branches are common findings — and SemperWise, our cybersecurity line, runs VAPT and penetration testing engagements for teams that want an independent view.
Measure what improves
The DORA metrics are a sensible, widely used way to see whether the pipeline is actually helping. DORA now defines five: change lead time, deployment frequency and failed deployment recovery time for throughput, and change fail rate and deployment rework rate for instability. Track them per team and look at trends, not league tables.
Common CI/CD mistakes
- Rebuilding per environment. Staging tested a different artifact from the one production runs.
- Long-lived cloud keys in CI secrets. They leak through logs, forks and former staff.
- Actions pinned to tags. A moved tag runs new code with your secrets.
- Wildcard OIDC trust. Every repository in the organisation can assume the production role.
- Gates that only warn. A scan nobody acts on is decoration; block on what matters and suppress the rest explicitly.
- Health checks that only check "running". Rollback never fires because the pod is up while every request fails.
- Destructive migrations in the same release as the code change. The rollback becomes a restore.
Rolling it out on an existing team
- Weeks 1–2. Inventory pipelines and secrets, turn on branch protection and secret scanning, and replace long-lived cloud keys with OIDC.
- Weeks 3–4. Move to one reusable workflow for build and test, pin every action to a SHA, and start recording DORA metrics.
- Weeks 5–6. Build once and promote by digest, add image scanning, signing and attestations, and enforce them at deploy.
- Weeks 7–8. Add canary or blue-green releases with automated rollback on SLO metrics, and document the expand-and-contract rule for migrations.
Done well, CI/CD is the backbone of both speed and safety: teams ship more often and sleep better. If you are migrating pipelines, consolidating on a platform, or need help with Kubernetes delivery through Kubernetes consulting or multi-tenant release processes for SaaS development, talk to a DevOps engineer. The first consultation is free.
CI/CD pipeline FAQ
What are the main stages of a CI/CD pipeline?
Build, test, scan, package, deploy and verify. Pull requests get the fast stages: build, unit and integration tests, linting and security scans. Merges to the main branch build one signed artifact, deploy it to staging, run end-to-end tests and then promote the same artifact to production behind a canary.
Which CI/CD tool should we use?
Use the one closest to your code. If it lives on GitHub, GitHub Actions is the natural choice; GitLab CI/CD suits teams that want everything in one product; Jenkins makes sense mainly for large existing estates. For Kubernetes, add Argo CD or Flux for GitOps delivery.
How do we deploy from GitHub Actions to AWS without access keys?
Use OIDC. Register token.actions.githubusercontent.com as an identity provider in AWS IAM, create a role whose trust policy checks the audience and subject claims, grant the workflow id-token write permission, and exchange the token for short-lived credentials with the configure-aws-credentials action.
What is SLSA and which level should we aim for?
SLSA is a framework for software supply-chain integrity. Version 1.2 is current as of October 2026 and has Build and Source tracks. Build Level 2, signed provenance from a hosted build platform, is a realistic first target, and GitHub artifact attestations provide it by default.
Should we pin GitHub Actions to a commit SHA?
Yes. Tags can be moved: in March 2025 the tags of the tj-actions/changed-files action were repointed to malicious code that leaked secrets into logs. Pin to full SHAs, let a bot propose updates, and enforce pinning across the organisation with GitHub's allowed-actions policy.
How long should a CI pipeline take?
There is no standard. Our working target is under ten minutes for pull-request feedback and under an hour from merge to production for a typical service. Caching, parallel jobs and moving slow suites to the merge stage are the usual fixes.
Want help putting this into practice?
Talk to a senior engineer about your specific situation — no sales script.






Compliance-first delivery