# Deploy pipeline

Every merge to main walks this path. Diagrams are Mermaid fences in the
Markdown itself, so the source stays one plain text file.

```mermaid
flowchart LR
  A[Merge to main] --> B[Build]
  B --> C{Tests pass?}
  C -->|yes| D[Deploy to staging]
  C -->|no| E[Notify author]
  D --> F{Smoke checks}
  F -->|green| G[Promote to production]
  F -->|red| H[Roll back]
```

## Rollback handshake

```mermaid
sequenceDiagram
  participant On-call
  participant Deployer
  participant Edge
  On-call->>Deployer: rollback v5
  Deployer->>Edge: activate v4
  Edge-->>Deployer: v4 serving 100%
  Deployer-->>On-call: done in 40s
```

Rollbacks target the previous version, never a rebuild.
