Skip to content

Commit cfbcaf7

Browse files
committed
Update CI setup to match Mockttp
1 parent 3b4f877 commit cfbcaf7

File tree

1 file changed

+36
-6
lines changed

1 file changed

+36
-6
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ jobs:
77

88
strategy:
99
matrix:
10-
node-version: [20.x, v22.14.0, 22.x, 24.x]
10+
include:
11+
- node-version: 20.x
12+
- node-version: 22.x
13+
- node-version: 'v22.20.0'
14+
deploys-docs: true
15+
- node-version: 24.x
16+
- node-version: '*'
1117

1218
steps:
1319
- uses: actions/checkout@v3
@@ -22,12 +28,36 @@ jobs:
2228
- run: npm install
2329
- run: npm run build
2430
- run: npm test
25-
env:
26-
NODE_OPTIONS: ${{ matrix.node-version == '22.x' && '--experimental-require-module' || '' }}
2731

28-
- name: Deploy docs
29-
if: github.ref == 'refs/heads/main' && matrix.node-version == 'v20.18.1'
30-
uses: JamesIves/github-pages-deploy-action@v4.5.0
32+
- name: Upload docs artifact
33+
uses: actions/upload-artifact@v6
34+
if: matrix.deploys-docs == true
35+
with:
36+
name: typedoc
37+
path: typedoc
38+
retention-days: 1
39+
40+
deploy-docs:
41+
name: Deploy docs
42+
needs: build
43+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
44+
runs-on: ubuntu-latest
45+
permissions:
46+
contents: write
47+
steps:
48+
- uses: actions/checkout@v6
49+
- uses: actions/download-artifact@v7
50+
with:
51+
name: typedoc
52+
path: typedoc
53+
- name: Check for generated docs
54+
run: |
55+
# Fails if directory doesn't exist or is empty
56+
if [ ! -d "typedoc" ] || [ -z "$(ls -A typedoc)" ]; then
57+
echo "Error: 'typedoc' directory is missing or empty."
58+
exit 1
59+
fi
60+
- uses: JamesIves/github-pages-deploy-action@v4
3161
with:
3262
single-commit: true
3363
branch: gh-pages

0 commit comments

Comments
 (0)