AWS Learning Journey

Merge, Build, Ship, Repeat: The CI/CD Fundamentals Behind Every Great Team

Git workflows, branching, pull requests, semantic versioning, pipeline stages, environment promotion, artifacts, rollbacks, blue-green, and canary deployments — the ideas that make shipping boring (in a good way).

8 min read · 1419 words
CI/CDDevOpsGitSoftware EngineeringAWS
Merge, Build, Ship, Repeat: The CI/CD Fundamentals Behind Every Great Team cover image

AWS from Zero to Production — Phase 7, Part 1 of 5 · See the full series roadmap


There are two kinds of teams.

The first deploys once a month. Releases are scheduled events. Everyone stays late. Something always breaks, and rolling back takes hours because nobody’s quite sure what changed.

The second deploys dozens of times a day. Each change is small. Every one is built, tested, scanned, and deployed automatically. When something breaks, they roll back in minutes — often before customers notice.

The second team isn’t braver or luckier. They’ve built a delivery system — and the ideas behind it aren’t complicated. This article covers them before we wire them into GitHub Actions and AWS.

What you’ll walk away with


CI, CD, and CD

The goal of all three: small changes, fast feedback, low risk.

Why small changes matter: A deploy with 3 changes that breaks is easy to debug. A deploy with 300 changes that breaks is an investigation.


Git workflows and branching strategies

Trunk-based development

This is what high-performing teams most often use, and it pairs naturally with continuous delivery.

GitHub Flow

GitFlow

Recommendation: For services you deploy yourself, use trunk-based development or GitHub Flow. Keep branches short-lived.


Pull requests that protect main

A pull request (PR) is where code gets reviewed and checked before it merges. Make main safe with branch protection or rulesets:

Good PRs are small, have a clear description, and link to the ticket or issue. Reviewers focus on design, correctness, and risk — linters and formatters handle style.


Semantic versioning

Semantic versioning (SemVer) gives versions a meaning: MAJOR.MINOR.PATCH.

2.4.1 -> 2.4.2    PATCH: backward-compatible bug fix
2.4.2 -> 2.5.0    MINOR: backward-compatible new feature
2.5.0 -> 3.0.0    MAJOR: breaking change

Pipeline stages

A typical pipeline runs these stages, failing fast:

1. Build     compile, install dependencies, build the container image
2. Test      unit tests, then integration tests
3. Scan      code, dependencies, container image, infrastructure code, secrets
4. Publish   push the versioned artifact to a registry
5. Deploy    to dev or staging -> verify -> to production
6. Verify    smoke tests, alarms, and metrics after each deploy

Fail fast: cheap checks — linting, unit tests — run first. Expensive checks run only if those pass.


Environment promotion

Changes move through environments in order, gaining confidence at each step:

commit -> build artifact abc123
              |
              +-> dev        automatic
              +-> staging    automatic, with integration tests
              +-> production approval, then deploy

Build once, deploy many

The same artifact — the same image digest — is promoted through every environment. You never rebuild for production.


Artifact management

An artifact is the output of a build: a container image, a ZIP file, a JAR, or a static site bundle.


Rollback strategies

Every deployment plan needs an answer to: what if this goes wrong?

The database problem

Code rolls back easily. Schema changes don’t. Use the expand and contract pattern:

1. Expand:   add the new column (old code ignores it)
2. Deploy:   new code writes both old and new columns
3. Migrate:  backfill data
4. Switch:   new code reads the new column
5. Contract: later, remove the old column

At every step, the previous version of the code still works — so you can always roll back.


Deployment strategies

Rolling

Replace instances or tasks a few at a time. The default for ECS. Simple, with no extra capacity, but old and new versions run side by side during the rollout.

Blue-green

Before:   users -> BLUE (v1)          GREEN (v2) being tested
Switch:   users -> GREEN (v2)         BLUE (v1) kept warm
Rollback: users -> BLUE (v1)          (instant)

Canary

5% of traffic   -> v2    watch errors and latency for 10 minutes
                         healthy? continue
100% of traffic -> v2

Linear deployments are similar, shifting traffic in equal steps — like 10% every minute.

On AWS: ECS supports rolling, blue-green, linear, and canary deployments; Lambda aliases and CodeDeploy shift traffic for functions; and Route 53 weighted records shift traffic at the DNS level.


Measuring delivery performance

The DORA metrics are a widely used way to measure delivery:

Speed and stability aren’t trade-offs. Teams that deploy more often, in small changes, tend to fail less and recover faster.


Common mistakes


Key takeaways


Quick self-check

Test yourself before moving on:

  1. Why shouldn’t you rebuild the image for production?
  2. What’s the safest way to make a breaking schema change?
  3. What’s the main advantage of a canary deployment?
  4. Version 1.9.3 gets a backward-compatible new feature. What’s the next version?

Answers

  1. Production would run an artifact that was never tested.
  2. Expand and contract — so old and new code both work at every step.
  3. It limits the blast radius: only a small share of users sees a bad release.
  4. 1.10.0.

What’s next

In Part 2, we build pipelines with GitHub Actions: workflow syntax, runners, secrets and variables, environments with approvals, reusable workflows, matrix builds, caching — and deploying to AWS with OIDC.

How often does your team deploy to production? Share your number in the comments.


Share this article

LinkedIn post draft