88 # Allows you to run this workflow manually from the Actions tab
99 workflow_dispatch :
1010
11- # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12- permissions :
13- contents : write
14- pages : write
15- id-token : write
11+ # Set permissions at the job level.
12+ permissions : {}
1613
1714# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
1815# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
@@ -21,7 +18,6 @@ concurrency:
2118 cancel-in-progress : false
2219
2320jobs :
24- # Build documentation, upload html
2521 # permissions: upload
2622 build :
2723 runs-on : ubuntu-slim
@@ -30,48 +26,45 @@ jobs:
3026 - uses : actions/setup-python@v6
3127 with :
3228 python-version : " 3.14"
29+ cache : ' pip'
30+
3331 - run : |
3432 python -m pip install --upgrade pip
3533 python -m pip install . --group=docs
3634 python -m pip list
35+
3736 - run : |
3837 sphinx-build --builder html docs/source/ docs/build/html
3938
39+ - name : Upload artifact
40+ uses : actions/upload-pages-artifact@v4
41+ with :
42+ name : docs-html
43+ path : ' ./docs/build/html'
44+
4045 deploy :
41- # permissions: upload, pages
46+ needs : build
47+ # Deploy only on push to master
48+ if : github.event_name == 'push' && github.ref == 'refs/heads/master'
49+ permissions :
50+ pages : write
51+ id-token : write
4252 environment :
4353 name : github-pages
4454 url : ${{ steps.deployment.outputs.page_url }}
45- # TODO: ubuntu slim enough?
4655 runs-on : ubuntu-slim
47- # download html
4856 steps :
49- - uses : actions/checkout@v6
50- - uses : actions/setup-python@v6
57+ - name : Download HTML artifact
58+ uses : actions/download-artifact@v4
5159 with :
52- python-version : " 3.14"
53- - run : |
54- python -m pip install --upgrade pip
55- python -m pip install . --group=docs
56-
57- # TODO: This gets included in docs/conf.py
58-
59- # - name: Sphinx APIDoc
60- # run: |
61- # sphinx-apidoc --force -o docs/source/ .
62- - name : Sphinx build
63- run : |
64- sphinx-build --builder html docs/source/ docs/build/html
65-
66- # # TODO: From here only on master branch
67-
68- # - name: Setup Pages
69- # uses: actions/configure-pages@v5
70- # - name: Upload artifact
71- # uses: actions/upload-pages-artifact@v4
72- # with:
73- # # Upload entire repository
74- # path: './docs/build/html'
75- # - name: Deploy to GitHub Pages
76- # id: deployment
77- # uses: actions/deploy-pages@v4
60+ name : docs-html
61+ path : docs/build/html
62+ - name : Setup Pages
63+ uses : actions/configure-pages@v5
64+ - name : Upload Pages artifact
65+ uses : actions/upload-pages-artifact@v4
66+ with :
67+ path : docs/build/html
68+ - name : Deploy to GitHub Pages
69+ id : deployment
70+ uses : actions/deploy-pages@v4
0 commit comments