CI/CD Pipeline

github actions → staging → production

Every push to main triggers the full pipeline. Tests and linting run in parallel, then the build step produces a Docker image. Staging deploys automatically; production requires manual approval via a GitHub environment gate.

      graph TD
        A[Push to main] --> B{Branch?}
        B -->|main| C[Run Tests]
        B -->|feature| I[Run Tests]
        I --> J[Preview Deploy]
        C --> D[Lint + Type Check]
        C --> E[Unit Tests]
        C --> F[Integration Tests]
        D --> G[Build Docker Image]
        E --> G
        F --> G
        G --> H[Deploy to Staging]
        H --> K{Smoke Tests Pass?}
        K -->|Yes| L[Manual Approval]
        K -->|No| M[Alert + Rollback]
        L --> N[Deploy to Production]
        N --> O[Health Check]
        O --> P[Done]
    
Automated step
Decision gate
Failure path
Success
Hand-drawn mode. This template uses look: 'handDrawn' for a sketchy aesthetic. Switch to look: 'classic' in the Mermaid config for clean, precise lines. The layout: 'elk' engine provides better node positioning for complex graphs — it requires the separate @mermaid-js/layout-elk package (imported above). Without it, Mermaid silently falls back to dagre.