CI: one pipeline, deploy gated on lint, test and audit
The deploy job lived in lint.yml and needed only eslint, while jest and npm audit ran in separate workflows. A merge that failed its tests still deployed to production. (#45 phase 1) - Combine everything into .gitea/workflows/ci.yml with jobs lint, test, audit, deploy and notify. Deploy needs all three checks and runs only on push to main. - Builds are reproducible: npm ci everywhere, eslint from the lockfile (new `npm run lint`), and setup-node pinned to Node 20 (production). - Actions are pinned to full commit SHAs, with the version in a comment, following tinker_tickets. - Workflow permissions default to contents: read; only deploy can write (for its tag). A deploy-production concurrency group queues deploys instead of running two at once. Superseded branch runs are cancelled. - The deploy payload now carries the sha and a timestamp, so signatures differ per deploy (the server verifies them in phase 2). After the webhook, CI waits until Pulse is serving again before tagging. - The Matrix alert now fires for any failed job on main, for the weekly audit, and for every successful deploy. - New lint step: fail on em or en dashes in Pulse-owned files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c6f6b3f842
commit
fde2c49eca
6 files changed
+153
-115
No files matched your search
@@ -589,7 +589,7 @@ MIT License - See LICENSE file for details
|
||||
| `security.yml` | `npm audit --audit-level=high` | Every push, PR, and weekly Monday 6am |
|
||||
| `deploy` job in `lint.yml` | Calls the `pulse-deploy` webhook on CT122 (10.10.10.65) to pull + restart | Push to `main` only, after lint passes |
|
||||
|
||||
Branch protection is enabled on `main`: the `lint.yml` check must pass before any PR can merge.
|
||||
All CI lives in `.gitea/workflows/ci.yml`. Branch protection on `main` requires its `Lint (eslint)`, `Test (jest)` and `Security (npm audit)` checks, and the `Deploy` job only runs after all three pass on a push to `main`.
|
||||
|
||||
Tests live in `tests/utils.test.js` and cover the pure utility functions in `lib/utils.js`:
|
||||
`validateWebhookUrl`, `applyParams`, `evalCondition`, `calculateNextRun`.
|
||||
|
||||
Reference in new issue
Block a user