1- name : Build and Deploy Docs
1+ name : Deploy Docs
22on :
33 push :
44 branches :
55 - main
6- paths :
7- - ' src/**'
8- - ' typedoc.json'
9- - ' package.json'
10- - ' package-lock.json'
11- - ' .github/workflows/deploy-docs.yml'
6+ # Allow re-publishing on demand, e.g. after a failed deploy or a Pages
7+ # settings change, without pushing an empty commit to main.
8+ workflow_dispatch :
129
1310permissions : {}
1411
12+ # Allow one concurrent deployment; queue rather than cancel so an in-flight
13+ # Pages deployment is never left half-applied.
14+ concurrency :
15+ group : pages
16+ cancel-in-progress : false
17+
1518jobs :
16- build-and-deploy-docs :
19+ build :
20+ # workflow_dispatch can be triggered from any ref, and the ref chosen is
21+ # what would get published. Only ever publish main. The push trigger is
22+ # already main-only, so this guard applies solely to manual runs.
23+ # `deploy` needs `build`, so skipping here skips the whole workflow.
24+ if : github.ref == 'refs/heads/main'
1725 runs-on : ubuntu-latest
1826 permissions :
19- contents : write
27+ contents : read
2028 steps :
2129 - name : Checkout
2230 uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
@@ -26,17 +34,31 @@ jobs:
2634 uses : actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
2735 with :
2836 node-version : ' 22'
29- # Pre-check to validate that versions match between package.json
30- # and package-lock.json. Needs to run before npm install
31- - name : Validate package.json and package-lock.json versions
32- run : node version-check.js
33- - name : Install dependencies
37+ # Root deps are required: docusaurus-plugin-typedoc reads ../src/*.ts
38+ # and needs the root dependency types to resolve.
39+ - name : Install root dependencies
40+ run : npm ci
41+ - name : Install docs dependencies
3442 run : npm ci
43+ working-directory : docs
3544 - name : Build docs
36- run : npm run docs
37-
38- - name : Deploy docs
39- uses : JamesIves/github -pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8 .0
45+ run : npm run build
46+ working-directory : docs
47+ - name : Upload Pages artifact
48+ uses : actions/upload -pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0 .0
4049 with :
41- branch : gh-pages # The branch the action should deploy to.
42- folder : docs # The folder the action should deploy.
50+ path : docs/build
51+
52+ deploy :
53+ needs : build
54+ runs-on : ubuntu-latest
55+ permissions :
56+ pages : write
57+ id-token : write
58+ environment :
59+ name : github-pages
60+ url : ${{ steps.deployment.outputs.page_url }}
61+ steps :
62+ - name : Deploy to GitHub Pages
63+ id : deployment
64+ uses : actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0
0 commit comments