Skip to content

Deploy pipeline

The agent runs one pipeline per service, under a flock, in this order.

#StageWhat the agent does
1admitDecodes the envelope. Checks the closed schema, the allowlists, repository equality, and the binding fields.
2verifyVerifies the cosign signature over the exact payload bytes. Hard gate, before any effect.
3idempotencySame digest and same env, already healthy, so it stops with no_op.
4pulldocker pull by digest, then re-checks that the resolved digest equals the requested one. Hard gate.
5envWrites the per-service env files to tmpfs, mode 0600.
6recreateGenerates the compose file and runs docker compose up -d as argv, never as a shell string.
7healthProbes the app over loopback. Exposure gate.
8proxyUpserts the host in NPMplus. Best effort.
9dnsUpserts the A record in Cloudflare. Best effort.
10persistAdvances the last-good record, the digest with its env and edge state, and answers with per-stage status.

Between admit and recreate the agent allocates this slot’s host port from a host-level registry in ports.json. statio is the only allocator, so two slots never publish the same host port.

verify and pull are hard gates: a failure there changes nothing. proxy and dns are best effort, so an outage at Cloudflare or NPMplus leaves a healthy container running. health runs before the edge, so a broken deploy never reaches the public.

A preflight runs admit, port availability, and proxy and DNS readiness, then stops. It pulls nothing, recreates nothing, writes no edge state, and changes no state at all.

CI posts the same signed payload to /preflight, so it passes the same signature gate as a deploy and is no anonymous probe.

Its stages: runtime, admit, ports, proxy, dns.

StateMeaning
successVerified, pulled, healthy, edge applied or not requested.
no_opSame digest and env, already healthy.
success_degradedThe container is healthy, and proxy or dns failed. Converges on the next deploy.
failure_rolled_backHealth failed, so the agent restored the previous image and env.
failureA hard gate failed at admit, verify, or pull. Nothing changed.
preflight_okA preflight passed every check. No deploy happened.

The Action treats success_degraded as a pass. Set its strict input to true to fail the job instead.