-
Notifications
You must be signed in to change notification settings - Fork 82
36 lines (33 loc) · 1.16 KB
/
Copy pathnode.js.yml
File metadata and controls
36 lines (33 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Node.js CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
# Guard against the committed output of scripts/generate-redirects.mjs
# drifting from content/blog. `prebuild` regenerates these during every
# deploy, so stale copies never break the live site -- which is exactly
# why the drift goes unnoticed until someone diffs them by hand.
- name: Routing artifacts are in sync with content/blog
run: |
npm run blog:redirects
if ! git diff --quiet -- public/_redirects public/_worker.js public/_routes.json vercel.json; then
echo "::error::Routing artifacts are stale. Run 'npm run blog:redirects' and commit the result."
git diff --stat -- public/_redirects public/_worker.js public/_routes.json vercel.json
exit 1
fi
- run: npm run build