22name : Documentation
33
44on :
5- # Runs on pushes targeting the default branch
65 push :
76 branches : ["master"]
8-
7+ workflow_call :
98 # Allows you to run this workflow manually from the Actions tab
109 workflow_dispatch :
1110
12- # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13- permissions :
14- contents : write
15- pages : write
16- id-token : write
11+ # Set permissions at the job level.
12+ permissions : {}
1713
1814# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
1915# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
@@ -22,32 +18,55 @@ concurrency:
2218 cancel-in-progress : false
2319
2420jobs :
25- # Single deploy job since we're just deploying
26- deploy :
27- environment :
28- name : github-pages
29- url : ${{ steps.deployment.outputs.page_url }}
30- runs-on : ubuntu-latest
21+ build :
22+ runs-on : ubuntu-slim
3123 steps :
32- - name : Checkout
33- uses : actions/checkout@v4
34- - name : Install dependencies
35- run : |
24+ - uses : actions/checkout@v6
25+ - uses : actions/setup-python@v6
26+ with :
27+ python-version : " 3.14"
28+ cache : ' pip'
29+
30+ - run : |
3631 python -m pip install --upgrade pip
3732 python -m pip install . --group=docs
38- - name : Sphinx APIDoc
39- run : |
40- sphinx-apidoc -f -o docs/source/ .
41- - name : Sphinx build
42- run : |
43- sphinx-build -b html docs/source/ docs/build/html
44- - name : Setup Pages
45- uses : actions/configure-pages@v5
33+ python -m pip list
34+
35+ - run : |
36+ sphinx-build --builder html docs/source/ docs/build/html
37+
4638 - name : Upload artifact
47- uses : actions/upload-pages-artifact@v3
39+ uses : actions/upload-pages-artifact@v4
4840 with :
49- # Upload entire repository
41+ name : docs-html
5042 path : ' ./docs/build/html'
43+
44+ deploy :
45+ needs : build
46+ # Deploy only on push to master
47+ if : github.event_name == 'push' && github.ref == 'refs/heads/master'
48+ permissions :
49+ pages : write
50+ id-token : write
51+ environment :
52+ name : github-pages
53+ url : ${{ steps.deployment.outputs.page_url }}
54+ runs-on : ubuntu-slim
55+ steps :
56+ # - name: Download HTML artifact
57+ # uses: actions/download-artifact@v4
58+ # with:
59+ # name: docs-html
60+ # path: docs/build/html
61+
62+ # - name: Setup Pages
63+ # uses: actions/configure-pages@v5
64+
65+ # - name: Upload Pages artifact
66+ # uses: actions/upload-pages-artifact@v4
67+ # with:
68+ # path: docs/build/html
69+
5170 - name : Deploy to GitHub Pages
5271 id : deployment
5372 uses : actions/deploy-pages@v4
0 commit comments