Skip to main content

One Workflow Per App

Each app gets one GitHub Actions workflow per slot, filtered to its own source path and triggered by a push to that slot’s branch. The run builds the image, pushes it to the registry, connects to the machine and brings the service up. The compose tag stays equal, per service, to the pushed tag, and every run queues on a lock held on the box, and the same pattern covers a cloud VM, rented hardware or a machine you own.

Blue and Green Slots

Each app runs two slots from the first deploy: green from the main branch, blue from the candidate branch, each with its own hostnames and env file. Both share one machine, so the candidate costs nothing extra. Promotion retags the image tested on blue instead of rebuilding it, so rollback is a single step. Every release is proven by three facts: the digest, the running container’s image id and a hostname that answers.

Claude Code as Harness

Claude Code works here as the harness: it writes the workflow, the compose service and the SQL delta, runs the review lenses, and reports the digest it verified rather than claiming success. Guard hooks and an approval gate define what may run unattended. Agents ship through the same pipeline as apps, each with its own workflow, two slots and identity. GitHub Copilot coding agent and code review share the same repository.
Stays Live
customers keep using the running release while the next version is tested
Identical Build
the version customers get is the exact candidate build that already proved itself in testing
Faster Releases
every push to the release branch starts the pipeline automatically, keeping new features on a steady cadence
Candidate Included
the tested candidate release runs on the same machine, inside the hosting you already pay for

One Pipeline Runs Two Slots and Proves Every Release

Build and Ship 4 steps
01

One Workflow Per App and Slot

A deploy that only one person remembers how to run breaks the day that person is out. Each app gets its own GitHub Actions workflow per slot, filtered to that app's source path and triggered by a push to the branch the slot builds from, so releasing never depends on a manual command. Claude Code writes and maintains these workflows in the repository, so the pipeline is reviewed like any other code.
02

Build Once, Run the Same Image Everywhere

Building the release separately for each environment is how a bug shows up in production that never appeared in testing. The workflow builds the image once, pushes it to the registry, then pulls and starts that exact image on the target machine. The tag on the box always matches the tag just pushed, per service, so what runs is what was tested.
03

Prove the Deploy, Don't Just Assume It

A pipeline that only reports success can still leave the wrong version running, or nothing reachable at all. Every run checks three facts before it counts as done: the image on the box carries the digest just pushed, the running container matches that image, and the public hostname answers. Two slots once stayed marked healthy for twenty-five hours while nobody could actually reach them, because no single one of those checks alone would have caught it.
04

One Deploy at a Time, Even Under Load

Two releases landing on the same machine at once is how a deploy corrupts itself instead of just failing cleanly. Every run builds in parallel but queues on a lock held on the target machine before it touches anything there, so concurrent releases never collide mid-write. A push that touches several workflows can still cancel a run that was mid-deploy, which is why the lock on the box, not the pipeline alone, protects it.
Blue and Green by Default 3 steps
05

Blue and Green From the First Deploy

Testing a release only after it reaches customers is how a bad update becomes an incident instead of a non-event. Each app runs two slots from day one: green serves customers from the main branch, blue carries the candidate from the same day, each with its own hostnames and environment file. Both share one machine, so the candidate costs nothing extra and nobody skips it to save money.
06

Promote by Retagging, Not Rebuilding

Rebuilding an image to promote it is how the version that goes live ends up differing, even slightly, from the one that was actually tested. Images carry no environment-specific detail baked in, so promotion simply retags the exact image that ran on blue instead of building a new one. An immutable tag then makes rolling back a single step instead of an emergency rebuild.
07

Change a Secret Without Guessing Whether It Took

A restarted container that keeps an old secret is a failure nobody notices until the wrong value gets used somewhere. Changing a secret or a connection string goes through the secrets MCP server, with a human in the loop, and still needs the container recreated afterwards, since a plain restart alone leaves the old value in place. A new hostname is only added once its DNS record resolves, so certificate validation never waits on a problem that was already fixed.
Agents in the Pipeline 2 steps
08

Agents Ship Through the Same Pipeline as Apps

An agent or automation running from someone's laptop is a dependency nobody can see or audit. An MCP server, an agent service or a scheduled worker counts as one more app in the estate: it gets its own workflow, its own two slots and the same release checks as everything else. A tool an agent calls proves itself on the candidate slot before it reaches the version people actually rely on.
09

Claude Code Writes the Pipeline and Works Inside It

A pipeline only one engineer understands is a pipeline that stalls the day that engineer is busy elsewhere. Claude Code works here as the harness: it writes the workflow and the compose service, runs the review checks, and reports the digest it verified rather than simply claiming success, with guard hooks and an approval gate deciding what may run unattended. GitHub Copilot coding agent and code review fit into the same repository, for teams already using them, so matching this to your own pipeline starts with a look at what you deploy today.

Frequently Asked Questions

What does proving a release landed actually involve?
Three checks run in sequence. The digest of the image just pushed is compared against the image on the box, which establishes that the right build is there. The running container's image id is compared against that image, which establishes that the running process is the one deployed. The public hostname is called and must answer. Two slots once ran healthy for twenty-five hours while nothing could reach them, because the container layer, the DNS layer and the edge layer were each correct on their own.
Does blue/green mean paying for a second environment?
Both slots run on the same machine, with their own containers, hostnames and env files, so the candidate environment adds no separate hosting line, and databases sit on one shared instance rather than one service per project. The candidate slot exists from the first deploy, which is what keeps promotion a retag of a tested image instead of a rebuild nobody has seen running.
Do agents get to deploy unattended?
Per environment, and the boundary is written down before the first run. Read-only checks, builds and candidate-slot deploys run unattended; anything touching the production slot passes an approval gate, and guard hooks enforce the limits rather than a reviewer remembering them. Every action carries the agent's own identity, so the audit trail names a subject rather than a shared service account.
How do secrets and connection strings get changed?
Secrets and connection strings are managed through a secrets MCP server, with a human in the loop before a value changes. The container still has to be recreated afterwards, since a restart alone keeps the old value: the env file only binds at container create time. Values never live in the image and never in a procedure file, which names the file holding a value instead of the value.