Skip to Content
CI/CD Pipeline

CI/CD Pipeline

Leadmetrics uses GitHub Actions for continuous integration. The pipeline lives in .github/workflows/pr-validation.yml.


Triggers

EventBranches
Pull request opened / updatedmaster, dev
Pushmaster, dev

Concurrency: one run per branch at a time. If a new push arrives while a run is in progress, the in-progress run is cancelled.


Jobs

1. Lint & Type Check

Runs first. All other jobs depend on this passing.

Checkout → pnpm install → Prisma generate → Type check → Lint
StepCommandWhat it checks
Type checkpnpm typecheckAll packages in the monorepo
Lintpnpm lintAll packages — ESLint rules

The Prisma client is generated first because typed DB queries won’t compile without it.

2. Unit Tests

Runs after lint & type check passes.

Checkout → pnpm install → Prisma generate → Build packages → Run unit tests
StepCommandNotes
Build packagespnpm build --filter=!api --filter=!dashboard --filter=!dm --filter=!manageBuilds shared packages only (not Next.js apps)
Unit testspnpm test:unitAll unit tests across the monorepo via Vitest

What’s Not in CI

ThingWhy
Integration testsRequire a live PostgreSQL database; run locally before merging
E2E testsRequire the full 8-service stack; run locally or on a dedicated test server
Database migrationsApplied manually or via deploy script on the server

Deployment

Deployment to production is done via Coolify on DigitalOcean. There is no automated deploy-on-merge pipeline; deployments are triggered manually through the Coolify dashboard.

Each service is deployed as a separate Docker container from the monorepo. The output: "standalone" setting in each Next.js app’s next.config produces a minimal Docker image.

See Infrastructure for the full deployment setup.


Running CI Checks Locally

Before opening a PR, run the same checks locally:

# Type check pnpm typecheck # Lint pnpm lint # Unit tests pnpm test:unit

If Prisma client is stale (after a schema change), regenerate first:

cd packages/db && pnpm db:generate

Branch Strategy

BranchPurpose
mainProduction-ready code
devIntegration branch for in-progress features
Feature branchesNamed feat/..., fix/..., chore/...

PRs go from feature branches → dev. Promotions from devmain are done after QA sign-off.

© 2026 Leadmetrics — Internal use only