feat: Update CI/CD workflow to trigger separate backend and dashboard deployments; enhance deployment documentation with Nginx proxy details and OAuth callback URLs
This commit is contained in:
+38
-24
@@ -3,26 +3,37 @@
|
||||
## Infrastructure Overview
|
||||
|
||||
```txt
|
||||
┌──────────────┐ HTTPS/WSS ┌───────────────────────────────────┐
|
||||
│ Discord APIs │◄───────────────────►│ Coolify deployment │
|
||||
└──────────────┘ │ ┌───────────────────────────────┐ │
|
||||
│ │ Backend container │ │
|
||||
│ │ - Discord gateway runtime │ │
|
||||
│ │ - Admin API (Express) │ │
|
||||
│ │ - Dailies pollers │ │
|
||||
│ └──────────────┬────────────────┘ │
|
||||
└─────────────────│──────────────────┘
|
||||
│
|
||||
▼
|
||||
┌───────────────────┐
|
||||
│ PostgreSQL │
|
||||
│ mileage + config │
|
||||
└───────────────────┘
|
||||
┌──────────────┐ HTTPS/WSS ┌──────────────────────────────┐
|
||||
│ Discord APIs │◄───────────────────►│ Coolify backend resource │
|
||||
└──────────────┘ │ port 8787 │
|
||||
│ - Discord gateway runtime │
|
||||
│ - Admin API (Express) │
|
||||
│ - Dailies pollers │
|
||||
└──────────────┬───────────────┘
|
||||
│
|
||||
▼
|
||||
┌───────────────────┐
|
||||
│ PostgreSQL │
|
||||
│ mileage + config │
|
||||
└───────────────────┘
|
||||
|
||||
┌──────────────────────────┐ HTTPS ┌─────────────────────────────┐
|
||||
│ Admin Dashboard (SPA) │◄───────────►│ Admin API + OAuth bridge │
|
||||
│ React/Vite static deploy │ │ │
|
||||
└──────────────────────────┘ └─────────────────────────────┘
|
||||
Internet
|
||||
│
|
||||
▼
|
||||
┌──────────────────────────┐
|
||||
│ Nginx edge reverse proxy │
|
||||
│ - TLS termination │
|
||||
│ - Host/path routing │
|
||||
└─────────────┬────────────┘
|
||||
│
|
||||
┌────────┴───────────┐
|
||||
▼ ▼
|
||||
┌───────────────┐ ┌──────────────────────────┐
|
||||
│ Coolify │ │ Coolify dashboard │
|
||||
│ backend │ │ resource │
|
||||
│ port 8787 │ │ port 80 │
|
||||
└───────────────┘ │ React/Vite static deploy │
|
||||
└──────────────────────────┘
|
||||
```
|
||||
|
||||
## CI/CD Pipeline
|
||||
@@ -32,14 +43,15 @@ Source file: `.gitea/workflows/ci-cd.yml`
|
||||
1. Bot job: install dependencies, run lint, build, and test.
|
||||
2. Dashboard job: install dependencies in `admin-dashboard`, run lint/build.
|
||||
3. Deploy job: on `main`, trigger Coolify webhook (optionally authenticated with token).
|
||||
4. In two-resource production setup, deploy webhooks can independently trigger backend and dashboard resources.
|
||||
|
||||
## Environment Matrix
|
||||
|
||||
| Environment | Runtime | Database | Notes |
|
||||
| ----------------- | --------------------------------- | -------------------------------------- | ------------------------------------------- |
|
||||
| Local development | Node.js process via `npm run dev` | Local/Postgres dev instance | Fast iteration, manual command registration |
|
||||
| CI | Ephemeral runner | Test/dev DB or mocked integration path | Quality gates before deployment |
|
||||
| Production | Coolify-managed container(s) | Managed PostgreSQL | Webhook-triggered deployment from Gitea |
|
||||
| Environment | Runtime | Database | Notes |
|
||||
| ----------------- | ------------------------------------------------ | -------------------------------------- | ---------------------------------------------------------------------------- |
|
||||
| Local development | Node.js process via `npm run dev` | Local/Postgres dev instance | Fast iteration, manual command registration |
|
||||
| CI | Ephemeral runner | Test/dev DB or mocked integration path | Quality gates before deployment |
|
||||
| Production | Nginx edge + Coolify backend/dashboard resources | Managed PostgreSQL | Host-based routing, TLS termination, webhook-triggered deployment from Gitea |
|
||||
|
||||
## Deployment Risks and Mitigations
|
||||
|
||||
@@ -47,3 +59,5 @@ Source file: `.gitea/workflows/ci-cd.yml`
|
||||
Mitigation: dashboard re-auth flow and short-lived session design.
|
||||
- Risk: DB connectivity interruptions.
|
||||
Mitigation: startup validation + retry behavior on mileage writes.
|
||||
- Risk: edge proxy misroutes dashboard/API traffic.
|
||||
Mitigation: verify upstream hostnames/ports and health checks after deploy.
|
||||
|
||||
Reference in New Issue
Block a user