CI/CD Pipeline: From Git Push to Canary Release

A developer pushes a commit at 4:55 PM on Friday. The pipeline runs, tests pass, and the change goes to production. By 5:10 PM, error rates spike. If your CI/CD pipeline can't roll back automatically, the on-call engineer spends the weekend firefighting. That's the difference between a pipeline that works and one that just runs. This article breaks down what a real CI/CD pipeline does, where teams get stuck, and how to choose your path — so you can ship fast without shipping outages.

What a CI/CD pipeline actually does (and why it's more than automation)

CI/CD stands for Continuous Integration and Continuous Delivery (or Deployment). The core idea is simple: every change goes through an automated assembly line that builds, tests, and deploys it. But the value isn't in the automation itself — it's in the feedback loop. A good pipeline catches bugs in minutes, not days. It makes releases boring, repeatable, and reversible.

The mechanism: when you push to Git, a trigger fires (webhook, polling, or scheduled). The pipeline pulls the code, runs unit and integration tests, builds a Docker image, pushes it to a registry, and then deploys to a staging or production environment. Each step is a gate — if tests fail, the pipeline stops. If they pass, the artifact moves forward. The key is that the same artifact (the Docker image) is promoted through environments, not rebuilt. That eliminates "works on my machine" drift.

But here's where beginners get stuck: they think CI/CD is just a YAML file with steps. In reality, it's a system with state, secrets, and failure modes. A pipeline that runs tests but doesn't cache dependencies will take 20 minutes instead of 5. A pipeline that deploys to production without a rollback plan is a liability. And a pipeline that stores secrets in plain text in the repo is a security incident waiting to happen.

GitHub Actions vs GitLab CI: which one fits your team?

Both are popular CI/CD tools, but they differ in philosophy and integration.

Criterion GitHub Actions GitLab CI
Hosting Cloud-hosted, self-hosted runners available Self-hosted or GitLab.com
Configuration YAML in .github/workflows YAML in .gitlab-ci.yml
Ecosystem Marketplace with thousands of actions Built-in templates and components
Secrets management Encrypted secrets at repo/org level Masked variables, external secret managers
Pricing Free tier for public repos, minutes-based for private Free tier with limited minutes, self-hosted free

If your code lives on GitHub, Actions is a natural fit. The marketplace lets you compose workflows from pre-built actions (e.g., actions/checkout, docker/build-push-action). But beware: third-party actions can introduce supply-chain risks — pin them to a specific commit SHA, not a tag.

GitLab CI shines if you need a single application for the entire DevOps lifecycle (repo, CI, registry, security scanning). Its include and extends keywords help manage complex pipelines. The trade-off: GitLab CI has a steeper learning curve for advanced features like directed acyclic graphs (DAG) with needs.

For a deeper comparison of CI/CD tools in the AWS context, see CodePipeline vs GitHub Actions: A CI/CD Pipeline Choice for AWS — and How to Master It with.

ArgoCD and canary deployments: the GitOps art

GitOps flips the deployment model: instead of pushing changes from CI, you store the desired state in Git and let an operator (like ArgoCD) pull and apply it. ArgoCD continuously compares the cluster state to the Git repo and syncs any drift. This gives you an audit trail (every change is a commit) and easy rollbacks (revert the commit).

But GitOps isn't a silver bullet. If your CI pipeline builds images and updates a Kubernetes manifest, you need to ensure the image tag is immutable (use SHA, not latest). Otherwise, ArgoCD might deploy a different image than you tested.

Canary deployments take this further: you route a small percentage of traffic (e.g., 5%) to the new version, monitor error rates and latency, and gradually increase if metrics look good. Tools like Argo Rollouts or Flagger automate this. The catch: you need robust observability (metrics, logs, traces) to make decisions. Without it, canary is just a slower way to break production.

A common mistake: teams adopt canary without defining success criteria. They look at dashboards manually and guess. Instead, define automated analysis: if error rate > 1% for 5 minutes, roll back. That's the art — encoding your operational knowledge into the pipeline.

A typical scenario: from commit to canary release

Imagine a team of five developers working on a microservice. They use GitHub Actions for CI and ArgoCD for CD. Here's what happens when a developer pushes a fix:

  1. Trigger: GitHub Actions starts a workflow on push to main.
  2. Test: Runs unit tests (2 min), integration tests against a temporary database (3 min).
  3. Build: Builds a Docker image, tags it with the commit SHA, pushes to GitHub Container Registry.
  4. Update manifest: A bot updates the Kubernetes deployment YAML in a separate gitops repo with the new image tag.
  5. ArgoCD sync: ArgoCD detects the change, applies it to the cluster.
  6. Canary rollout: Argo Rollouts sends 10% of traffic to the new version. Prometheus metrics show error rate at 0.5% (baseline 0.4%). After 10 minutes, it increases to 50%, then 100%.
  7. Rollback: If error rate exceeds 1%, Argo Rollouts automatically reverts to the previous version.
From commit to canary release in 30 minutes
1
Git push
Developer commits to main
2
CI trigger
GitHub Actions starts workflow
3
Test & build
Unit/integration tests, Docker image
4
Update manifest
Bot updates image tag in GitOps repo
5
ArgoCD sync
Applies change to Kubernetes cluster
6
Canary rollout
10% traffic, monitor metrics, then 100%

The entire process takes 20–30 minutes, with no manual steps. But setting it up requires careful configuration: secrets for the registry, RBAC for ArgoCD, and monitoring hooks.

If you skip the canary step and deploy directly, a bug that affects 100% of users will be live for everyone. Canary limits the blast radius.

For a real-world breakdown of pipeline mistakes, read CI/CD as an Art: A Real Pipeline Breakdown and Costly Mistakes.

Where beginners get stuck (and how to avoid it)

1. Secrets in plain text. Storing API keys in the repo is a classic. Use GitHub Secrets or GitLab masked variables. Better: use a dedicated secret manager (HashiCorp Vault, AWS Secrets Manager) and inject at runtime.

2. Slow pipelines. Without caching, every run downloads dependencies from scratch. Enable caching for package managers (npm, pip, Maven). Use Docker layer caching. A pipeline that takes 30 minutes will be bypassed — developers will merge without waiting.

3. Flaky tests. Tests that fail intermittently destroy trust. Quarantine flaky tests and fix them. A pipeline that cries wolf gets ignored.

4. No rollback plan. If deployment fails, you need a way back. Blue-green or canary with automated rollback is safer than kubectl apply and hope.

5. Ignoring pipeline as code. Manual steps in the UI are undocumented and unreproducible. Treat your pipeline configuration as code, version it, and review changes.

Learning paths: self-study vs structured course vs on-the-job

Path Time Cost Outcome
Self-study (docs, tutorials) 2–6 months Free to low Fragmented knowledge, gaps in best practices
Structured course 1–3 months $200–$1000 Systematic coverage, feedback on exercises
On-the-job 6–12 months Salary Deep practical skills, but slow and risky

Self-study works if you already have a mentor or a strong background. But CI/CD has many moving parts — secrets, caching, deployment strategies — and it's easy to miss critical details. A structured course can accelerate your learning by providing a curated path and feedback on your pipelines. However, courses vary in quality; look for ones that cover real tools (GitHub Actions, ArgoCD) and include hands-on labs.

On-the-job learning is invaluable but comes with production risk. You don't want to learn canary deployments by breaking prod.

If you're considering a course, the CI/CD Pipeline on asibiont.com offers personalized lessons that adapt to your level, covering GitHub Actions, GitLab CI, ArgoCD, and canary deployments. It's one option among many — evaluate if it fits your learning style.

Who this is for (and who it isn't)

This article (and the course) suits:

  • DevOps engineers who want to formalize their pipeline knowledge.
  • SREs responsible for deployment reliability.
  • Platform teams building internal developer platforms.
  • Developers who want to own their deployments end-to-end.

It's not for you if:

  • You're looking for a quick certification (asibiont.com doesn't issue certificates).
  • You have no basic familiarity with Git and containers — you'll need to learn those first.
  • You expect a magic bullet; CI/CD requires practice and iteration.

The bottom line

A CI/CD pipeline is not a set of YAML files — it's a system that encodes your team's release process. Get it right, and you ship confidently multiple times a day. Get it wrong, and you're either moving too slow or breaking things fast. The tools (GitHub Actions, GitLab CI, ArgoCD) are means to an end; the art is in designing feedback loops, safe rollouts, and automated rollbacks.

If you want a structured path to master this, the CI/CD Pipeline course provides hands-on lessons that adapt to your pace, covering everything from pipeline basics to canary deployments. Start there, and you'll be building production-ready pipelines sooner than you think.

AssetMaterials for this article

A document from this article — download and apply it.

  • DOCXCI CD Pipeline Production-Readiness Checklist.docxDOCX · 38 KBDownload
← All posts

Ask AI about this article

Ask a question about this article — ASI Biont will answer based on its text and the attached files.