Bỏ qua nội dung

CI/CD

Phạm vi hệ thống

  • CI/CD là yêu cầu hệ thống, không phải feature.
  • Áp dụng cho 2 project hiện có:
    • v-nexus-backend
    • v-nexus-frontend
  • mobile: chưa có trong phạm vi hiện tại.

Trạng thái hiện tại

ProjectTrạng thái CITrạng thái CDGhi chú
Backend (v-nexus-backend)Có GitHub Actions (ci-pr.yml, ci-test.yml)Có auto deploy môi trường testDeploy qua GHCR + Cloudflare Tunnel SSH + Docker Compose
Frontend (v-nexus-frontend)Chưa có workflow GitHub Actions trong repoChưa có pipeline tự động trong repoCó command Cloudflare để build/deploy thủ công (build:cf, deploy:cf)

Sơ đồ tổng thể 2 project

flowchart LR
  DEV[Developer] -->|01. Push/PR| GH[GitHub]

  subgraph BE[Backend CI/CD - Active]
    GH -->|02. PR -> test| BEPR[ci-pr.yml]
    BEPR -->|03. Merge -> test| BEPUSH[ci-test.yml]
    BEPUSH -->|04. Build/Push| GHCR[(GHCR)]
    BEPUSH -->|05. Deploy| CFSSH[Cloudflare Access + Tunnel SSH]
    CFSSH -->|06. Remote docker compose| SERVER[Test Server]
    SERVER -->|07. Smoke| SMOKE[API smoke tests]
    SMOKE -->|08. Notify| TG[Telegram]
  end

  subgraph FE[Frontend CI/CD - Current]
    GH -->|09. Manual release by dev| FEMANUAL[npm run build:cf\nnpm run deploy:cf]
    FEMANUAL -->|10. Deploy| CFW[Cloudflare Workers]
  end