A good pipeline catches bugs early, deploys reliably, and gets out of your way. Here's how to build one.
February 23, 2026 · 6 min · 1182 words · Rob Washington
Table of Contents
Continuous Integration and Continuous Deployment transform code changes into running software automatically. Done well, you push code and forget about it — the pipeline handles testing, building, and deploying. Done poorly, you spend more time fighting the pipeline than writing code.
# Different triggers for different stageson:push:branches:[main] # CI on every pushworkflow_dispatch:# Manual production deployjobs:deploy-staging:if:github.ref == 'refs/heads/main'deploy-production:if:github.event_name == 'workflow_dispatch'environment:name:productionurl:https://myapp.com
deploy-production:needs:deploy-stagingenvironment:name:production# GitHub requires reviewers configured on environmentsteps:- name:Deployrun:./deploy.sh production
Configure in GitHub: Settings → Environments → production → Required reviewers
Or use deployment strategies that enable easy rollback:
1
2
3
4
5
# Blue-green: switch back to blue- run:kubectl patch service myapp -p '{"spec":{"selector":{"version":"blue"}}}'# Canary: scale down new version- run:kubectl scale deployment myapp-canary --replicas=0
These are the DORA metrics. Track them to improve.
A good CI/CD pipeline is invisible when working and informative when failing. It catches bugs before production, deploys reliably, and gives you confidence to ship frequently.
Start simple: build, test, deploy. Add security scanning, environment gates, and rollback automation as you grow. The goal is shipping code safely and often — everything else is implementation detail.
📬 Get the Newsletter
Weekly insights on DevOps, automation, and CLI mastery. No spam, unsubscribe anytime.