DApp Pipeline
The DApp pipeline runs on changes to the dapp or contracts workspaces and ships the mainnet and testnet deployments. It includes unit tests, smart contract tests, predeploy E2E validation, testnet smoke tests, rollback, and then mainnet deploy.
Triggers and change detection
| Trigger | Details |
|---|---|
| push / pull_request | Runs on main for changes in dapp/**, colored-keys/**, or workflow/action files |
| workflow_dispatch | Manual run from GitHub Actions UI |
| paths-filter | Sets dapp and contracts flags for conditional jobs |
Workflow or action file changes trigger the workflow, but all jobs will skip because the
paths filter only checks dapp/** and colored-keys/**. Use
workflow_dispatch when testing CI changes.
Job flow
- Change detection:
dorny/paths-filtermarks whether dapp or contracts changed. - ESLint: runs only when dapp changes or manual dispatch.
- Unit tests: Vitest with Codecov upload via OIDC.
- Hardhat tests: runs when contracts change or manual dispatch.
- Predeploy E2E: local build with Postgres service and Playwright smoke tests.
- Deploy testnet: prebuilt Vercel deploy (local build +
vercel deploy —prebuilt). - Smoke tests: Playwright E2E and Supertest API tests run in parallel against testnet.
- Rollback testnet: rolls back to previous production URL if smoke tests fail.
- Deploy mainnet: prebuilt Vercel deploy after testnet smoke tests pass.
Workflow Diagram
Deploy mode
- Testnet and mainnet use
mode: prebuiltin thevercel-deployaction. - Builds run from repo root; Vercel Root Directory must point at
dappfor the DApp projects.
Coverage behavior
- DApp unit tests upload coverage to Codecov when running in this pipeline.
- Coverage reports are also uploaded as GitHub artifacts for every unit-test run.
Rollback behavior
Rollback is only enabled on testnet. Smoke tests on testnet are treated as a close approximation of mainnet behavior, and mainnet skips smoke tests because it targets live chains. The rollback flow can be added to mainnet if desired.
Required secrets and vars
| Name | Type | Used for |
|---|---|---|
| VERCEL_TOKEN | Secret | All Vercel deploys |
| VERCEL_ORG_ID | Secret | All Vercel deploys |
| VERCEL_PROJECT_ID | Secret | All Vercel deploys |
| PRIVATE_KEY_PLAYWRIGHT | Secret | Playwright smoke tests |
| PRIVATE_KEY_API | Secret | Supertest API smoke tests |
| TOKEN_ID | Secret | Supertest API smoke tests |
| TEST_BASE_URL | Var | Base URL for smoke tests (currently testnet) |
| CHAIN_ID | Var | Supertest chain ID |
| NEXT_PUBLIC_ENABLE_STATE_WORKER | Var | Supertest toggle for state worker |
| NEXT_PUBLIC_AI_CHAT_REQUIRES_JWT | Var | Supertest toggle for JWT requirements |