CI/CD
Audience: devops, backend
Status: specced
Owns: devops
Depends on: System architecture, Backend stack ADR, Observability
Decision: GitHub Actions
Section titled “Decision: GitHub Actions”Accepted: GitHub Actions for pipeline definition and UI. Runners may be self-hosted later if needed.
Considered, not chosen:
| Tool | Notes |
|---|---|
| Woodpecker | Simple, Drone-compatible, self-hosted — thinner UI than GHA |
| Gitea Actions | Nice UI if git hosting moved to Gitea; not current hosting model |
| Drone CI | Near-identical to Woodpecker; no reason to pick over Woodpecker if self-hosting |
Target: Actions deploy Orchestrator / CAP / @elimi/common / @elimi/proto. Gateway hosts:
| Env | Hostname |
|---|---|
| Staging | www.staging-api.elimi-ecosystem.e-limi.africa |
| Production | api.elimi-ecosystem.e-limi.africa |
Paths: /v1/ol/…, /v1/cap/…, /v1/lms/… (and later /v1/wm/…).
Current VPS bridge (artifact + PM2)
Section titled “Current VPS bridge (artifact + PM2)”Until container registry + Swarm/K8s are online, deploys use immutable tarballs from GitHub Actions → SCP → release directories under ~/elimi-ecosystem/<app>_<env>/ → current symlink → pm2 reload (cluster mode). Runbook: monorepo infra/deploy/README.md.
- Pack:
infra/deploy/pack.sh - Activate:
infra/deploy/activate.sh(migrate → deploy console commands → optional seed → symlink flip, health gate, rollback) - Workflow:
.github/workflows/deploy-orchestrator.yml— pushstaging→ staging VPS; pushmain→ production VPS (Environment approval);workflow_dispatchfor either
Pipeline stages (per service)
Section titled “Pipeline stages (per service)”- Lint
- Type-check
- Unit tests
- Pack deployable artifact (tarball today; container image later)
- Integration tests (
docker-composeagainst real Postgres + RabbitMQ) - Push artifact / registry (Actions artifact + SCP today; GHCR later)
- Deploy to staging
- Manual promote to production
Migrations: each service owns Prisma migrations; activate runs prisma migrate deploy on the VPS before flipping current. Deploy console commands (node dist/console/cli.js --deploy) run after migrate and before optional seed — see Console commands. Keep event/API changes backward-compatible for at least one release so services need not deploy in lockstep.
Containers and PM2
Section titled “Containers and PM2”- Longer-term: containerize every service;
docker-composefor local (services + Postgres instances + RabbitMQ + SigNoz); Swarm then K8s when needed. - Current VPS: PM2 is the process manager (cluster mode, ≥2 instances) under release dirs.
- Inside a future container, PM2 may still own cluster mode for CPU cores only — do not double-cluster restart logic with Swarm/K8s.
Secrets and backups
Section titled “Secrets and backups”- Secrets: CI secrets store → env injected at deploy; Vault later if sprawl grows.
- Postgres:
pgBackRestorWAL-G— WAL archive + nightly base backup to S3-compatible storage. - Schedule restore drills — an untested backup is a hypothesis.
See also
Section titled “See also”- Shared quality gates → Coding standards
- Staging gateway paths → System architecture
- Deploy-time CLI tasks → Console commands