Skip to main content
XenonStack

DevOps

XenonStack Blog CI/CD Pipeline: Stages, Tools and Best Practices

and | Published | Updated

CI/CD Pipeline: Stages, Tools and Best Practices
12:18

Key takeaway

  • CI/CD for enterprise teams: pipeline stages, continuous delivery vs deployment, tool comparison, DORA metrics, pipeline security and adoption.

CI/CD is the automated path that takes a code change from a developer's commit to a release. Continuous integration (CI) merges changes often and builds and tests each one automatically. Continuous delivery keeps every build ready to release on demand, and continuous deployment goes one step further and releases every passing change to production without a manual approval.

This guide is for engineering leaders who need to decide how far to automate, which tools to standardise on, and how to keep the pipeline itself secure. It covers the stages, a tool comparison, the DORA delivery metrics, pipeline security and an adoption order. For a wider toolchain view, see our guide to DevOps tools, and for security controls inside the pipeline, see DevSecOps.

What do CI, continuous delivery and continuous deployment each mean?

The three terms are often used as one. They are separate decisions with different risk. DORA defines continuous delivery as "the ability to release changes of all kinds on demand quickly, safely, and sustainably", and separates it from continuous deployment, which automatically deploys every change.

PracticeWhat it doesWho decides the releaseFits when
Continuous integrationDevelopers merge small changes often; each merge triggers an automated build and testsNot applicable; it stops at a tested buildEvery team writing shared code
Continuous deliveryEvery passing build is kept deployable, with deployment automatedA person or policy approves the release to productionRegulated systems, or releases tied to business dates
Continuous deploymentEvery change that passes the pipeline goes to production automaticallyThe pipeline, using tests and policy as the gateStrong automated tests, fast rollback and small changes

Source: DORA, Continuous delivery capability, read 11 November 2026. For the deployment side in detail, read our guide to continuous deployment.

What are the stages of a CI/CD pipeline?

A pipeline is a sequence of automated stages, each of which can stop the change. The names vary by tool. GitLab, for example, defines stages such as build, test and deploy in a .gitlab-ci.yml file in the project root, and runners execute the jobs in each stage.

Two-column diagram: source, build, test and staging, and release and monitor stages mapped to protected branches, build checks, test and policy gates, and approval or automatic release
StageWhat happensWhat should fail the build
Source and version controlA commit or merge request starts the pipeline; all production artefacts, including configuration and scripts, are versionedUnreviewed changes to protected branches
BuildCode is compiled or packaged into an artefact or container imageBuild errors, missing dependencies
Unit and static testsFast tests and code checks run first so failures show earlyFailing tests, policy or quality violations
Integration and staging testsThe artefact is deployed to a staging environment for integration and end-to-end testsFailing integration tests, configuration drift
Release and deployThe artefact is promoted to production, by approval (delivery) or automatically (deployment)Failed health checks; trigger rollback
Monitor and feedbackTelemetry shows whether the release is healthy and feeds the next changeError budget or service-level breach

Running the fastest tests first and keeping the whole pipeline short gives developers feedback while the change is still fresh. DORA lists test automation, deployment automation, trunk-based development with short-lived branches, version control for all production artefacts and monitoring among the practices behind continuous delivery. Safer release patterns such as blue-green are covered in our guide to blue-green deployment in Kubernetes.

Which CI/CD tools fit which team?

Pick the tool that sits closest to your source code and your hosting rules, then standardise. The table lists what each vendor or project states about itself, read on 11 November 2026. It is not a ranking.

ToolWhat it is (from its own site)When it fitsCheck before you commit
GitHub ActionsCI/CD platform; workflows are YAML files in .github/workflows, triggered by events; runners are GitHub-hosted (Linux, Windows, macOS) or self-hostedCode already on GitHubPin third-party actions and restrict token permissions (see security section)
GitLab CI/CDPipelines defined in .gitlab-ci.yml with stages, jobs and runners; on GitLab.com or self-managedTeams using GitLab for source and deliveryRunner capacity and self-managed upgrade effort
JenkinsOpen source automation server to build, test and deploy; LTS 2.580.2 and weekly 2.590 on 11 November 2026Teams that need self-hosted control and run it themselvesYou own upgrades, hardening and capacity
CircleCIHosted CI/CD with Cloud, Runner (hybrid) and Server (on-premises) options, plus OrbsMixed cloud and on-premises runnersConfirm plan limits with the vendor
TeamCityJetBrains CI/CD solution; runs on Windows, macOS, Linux and DockerJetBrains-centred or mixed-platform buildsConfirm hosting options with JetBrains
BambooAtlassian's page offers Bamboo Data CenterExisting Atlassian Data Center estatesConfirm the support timeline with Atlassian before a new rollout
Travis CIDescribes itself as a CI/CD tool configured as code; enterprise self-hosted "Server" optionExisting usersConfirm current plans on the vendor site
TektonOpen source framework for building CI/CD systems; CNCF incubating projectPlatform teams building their own Kubernetes-based CI/CDYou assemble and operate the platform
Argo (GitOps)Kubernetes-native tools to run workflows, manage clusters and do GitOps; CNCF graduated 6 December 2022Kubernetes delivery driven from GitNeeds a separate CI stage upstream

Our DevOps tools guide covers the wider toolchain, including infrastructure as code, monitoring and testing.

How do you measure whether CI/CD is working?

Use the DORA software delivery metrics rather than counts of pipelines or builds. DORA groups five measures into throughput and instability.

GroupMetricWhat it measures
ThroughputChange lead timeTime from commit to running in production
ThroughputDeployment frequencyHow often deployments happen
ThroughputFailed deployment recovery timeTime to recover from a failed deployment that needs urgent repair
InstabilityChange fail rateShare of deployments that need urgent follow-up, such as a rollback or hotfix
InstabilityDeployment rework rateShare of deployments that are unplanned and triggered by a production incident

Source: DORA metrics guide, read 11 November 2026. Track both groups together. Faster releases with a rising change fail rate mean the pipeline is moving risk, not removing it.

How do you secure a CI/CD pipeline?

A pipeline holds credentials and can change production, so treat it as production infrastructure. GitHub's hardening guidance for Actions recommends pinning third-party actions to a full-length commit SHA, defaulting the token to read-only access and raising permissions per job, using environment protection rules with required reviewers, and using OpenID Connect to reach cloud providers instead of storing long-lived credentials as secrets. The same principles apply on other platforms.

Two frameworks give a common language for this work. The NIST Secure Software Development Framework (SP 800-218, version 1.1, final February 2022) offers high-level secure development practices to add to any lifecycle. SLSA, whose current specification is version 1.2, defines Build and Source tracks for describing and improving supply chain security. Sources: GitHub Docs, NIST and SLSA, read 11 November 2026. For the full programme, see our DevSecOps guide.

What goes wrong with CI/CD, and when should you not deploy automatically?

Most failures are organisational, not technical. These are the most common.

ProblemWhy it happensWhat to do
Automating the wrong process firstTeams automate what is easy, not what is frequent, slow or error-proneRank processes by frequency, delay and error rate before automating
Delivery and deployment confusedTeams assume every pipeline must release to productionDecide per service whether a person or policy approves the release
Slow, flaky pipelinesTests are slow or unreliable, so developers bypass themRun fast tests first, quarantine flaky tests, keep the pipeline short
Vanity dashboardsTeams track pipeline counts, not outcomesTrack the DORA metrics and act on them
Skills gap and upkeepPipelines need ongoing maintenance across many servicesAssign platform ownership, share templates, retire unused pipelines
Weak test coverageAutomatic release amplifies bad testsHold at continuous delivery until tests and rollback are trusted

Continuous deployment is not right for every system. Keep a human or policy approval step where a release needs audit evidence, has no fast rollback, or touches data that cannot be repaired afterwards. Continuous delivery with a short approval is a sound end state for many enterprise services.

In what order should you adopt CI/CD?

StepActionExit test
1Put all code, configuration and pipeline definitions in version control; adopt short-lived branchesEvery production artefact is traceable to a commit
2Automate build and unit tests on every mergeBuilds are green on the main branch by default
3Add integration tests and a staging deploymentA release candidate can be deployed on demand
4Add security checks, secrets handling and least-privilege tokensNo long-lived credentials in pipeline settings
5Automate production deployment with health checks and rollbackA failed release recovers without manual rebuilds
6Measure the DORA metrics and review them monthlyTargets set per service, owners named

Where release decisions are made by software agents as well as people, the pipeline needs the same governance as any other automated actor. ElixirClaw is an agentic OS platform to build, orchestrate and govern AI agents and automation workflows while keeping humans in control. For agile and delivery workflows, AgentScrum takes over routine Agile tasks such as organising sprints and tracking impediments and progress charts. After release, AgentSRE uses coordinated AI agents to spot problems, trace their causes and fix them.

To map one release or rollback decision your pipeline and agents should make, and the context and policy it depends on, book a Context Workshop. See what happens in the workshop.

Frequently asked questions about CI/CD

What is the difference between continuous delivery and continuous deployment?

Continuous delivery keeps every passing build ready to release on demand, with a person or policy approving the release. Continuous deployment releases every passing change to production automatically, with no manual approval.

What is a CI/CD pipeline?

It is the automated sequence that takes a commit through build, tests, staging and release. Each stage can stop the change, and the result feeds back to the developer. In GitLab, for example, stages such as build, test and deploy are defined in a .gitlab-ci.yml file.

Which metrics show that CI/CD is working?

DORA uses five: change lead time, deployment frequency, failed deployment recovery time, change fail rate and deployment rework rate. The first three measure throughput and the last two measure instability.

How do you secure a CI/CD pipeline?

Pin third-party actions to a full commit SHA, default tokens to read-only, require reviewers on protected environments, and use OpenID Connect instead of long-lived cloud credentials. NIST SSDF and SLSA give a framework for the wider programme.

Should every team use continuous deployment?

No. Use it where tests are strong, changes are small and rollback is fast. Where releases need audit evidence or cannot be reversed easily, keep continuous delivery with an approval step.

Next Steps: How to Get Started with CI/CD

Consult with our experts on implementing Continuous Integration (CI) and Continuous Delivery (CD) systems. Learn how industries use CI/CD pipelines and automated testing to drive efficiency and agility in software deployment.

Follow XenonStack on LinkedIn: XenonStack on LinkedIn for new guides on agentic AI, data and platform engineering.

Table of Contents

navdeep-singh-gill

Navdeep Singh Gill

Global CEO and Founder of XenonStack

LinkedIn profile

Navdeep Singh Gill is serving as Chief Executive Officer and Product Architect at XenonStack. He holds expertise in building SaaS Platform for Decentralised Big Data management and Governance, AI Marketplace for Operationalising and Scaling. His incredible experience in AI Technologies and Big Data Engineering thrills him to write about different use cases and its approach to solutions.

Get the latest articles in your inbox

Subscribe Now

Interested in solving your challenges with the XenonStack team?
Get Started

Tell us about you and your priorities so we can prepare the right conversation. It takes about 2 minutes.

Please Select your Industry
Banking
Fintech
Payment Providers
Wealth Management
Discrete Manufacturing
Semiconductor
Machinery Manufacturing / Automation
Appliances / Electrical / Electronics
Elevator Manufacturing
Defense & Space Manufacturing
Computers & Electronics / Industrial Machinery
Motor Vehicle Manufacturing
Food and Beverages
Distillery & Wines
Beverages
Shipping
Logistics
Mobility (EV / Public Transport)
Energy & Utilities
Hospitality
Digital Gaming Platforms
SportsTech with AI
Public Safety - Explosives
Public Safety - Firefighting
Public Safety - Surveillance
Public Safety - Others
Media Platforms
City Operations
Airlines & Aviation
Defense Warfare & Drones
Robotics Engineering
Drones Manufacturing
AI Labs for Colleges
AI MSP / Quantum / AGI Institutes
Retail Apparel and Fashion

Continue