← Back to work

Case Study · 2026

Multi-Environment ECS Deployment Pipeline

CI/CD architecture and hands-on implementation — a Build Once, Deploy Many pipeline shipping a containerized app through Dev, Stage and Production on Amazon ECS.

RoleDevOps & Cloud Engineer
Timeline2026
FocusCI/CD · AWS · ECS
SourceGitHub ↗
MULTI-ENV ECS PIPELINE

Context

A containerized application needed a repeatable path from commit to production — one image, three environments, and a release process that could stand up to real enterprise expectations: consistency, traceability, and controlled promotion.

The Problem

Rebuilding the image at every stage means Dev, Stage and Prod never run the same artifact — the root cause of "it worked in staging" bugs. The goal: one image, provably identical across all three environments, promoted only through human-approved gates.

Process

01

01 — Build once, tag once

A single Docker image is built and pushed to Amazon ECR per pipeline run. The image tag is passed between GitHub Actions jobs as a workflow output and reconstructed at deploy time, rather than rebuilt — removing an entire class of environment-drift bugs before they can happen.

02

02 — Environment isolation by design

Each environment — Dev, Stage, Prod — runs its own ECS cluster, service, and task definition, configured through GitHub Environments with scoped variables (ECS_CLUSTER, ECS_SERVICE, ECS_TASK_DEFINITION). No shared state, no cross-environment blast radius.

03

03 — Governance as a pipeline primitive

Dev deploys automatically on a successful build. Stage and Production sit behind GitHub Environments' native approval gates — promotion only happens on explicit human sign-off, modeling the release discipline of a real enterprise workflow rather than a demo shortcut.

Design Decisions

Build Once, Deploy Many

The image is immutable from build to Production. Promotion means redeploying the same artifact with a new environment configuration — not a new build — which is the difference between 'should behave the same' and 'is the same.'

Approval gates on Stage and Prod, not Dev

Dev stays fast for iteration and validation. Stage and Prod are protected checkpoints, matching how release risk actually escalates as code moves closer to users.

Fargate over self-managed infrastructure

ECS on Fargate removes cluster and instance management from the pipeline's scope, keeping the workflow focused on deployment logic rather than infrastructure upkeep.

Outcome

A working three-environment pipeline with zero image rebuilds after the initial build

Manual approval gates enforced natively through GitHub Environments — no third-party approval tooling required

Reflection

A pipeline is only as trustworthy as its weakest promotion step — automating the build was the easy part; making Stage and Prod provably identical to what passed review is the part that actually matters.