Skip to content
This repository was archived by the owner on Jan 9, 2026. It is now read-only.

Commit 41bc695

Browse files
ci: fail Sphinx doc builds on warnings
- Updated workflow to use `sphinx-build -W` to treat warnings as errors - Blocks PR merges if doc build fails due to warnings - On successful merge to `main`,rebuilds and deploys docs to GitHub Pages It's based on work by @jimmac
1 parent e4de151 commit 41bc695

File tree

1 file changed

+39
-7
lines changed

1 file changed

+39
-7
lines changed

.github/workflows/sphinx-deploy.yml

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,49 @@ name: Deploy Sphinx documentation to Pages
22

33
on:
44
push:
5-
branches: [main] # branch to trigger deployment
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
68

79
jobs:
8-
pages:
10+
build:
911
runs-on: ubuntu-latest
10-
environment:
11-
name: github-pages
12-
url: ${{ steps.deployment.outputs.page_url }}
12+
permissions:
13+
contents: read
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: 3.11
22+
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install -U pip
26+
pip install -r docs/requirements.txt
27+
28+
- name: Build docs with Sphinx (fail on warnings)
29+
run: |
30+
sphinx-build -W -b html docs/ build
31+
32+
- name: Upload artifact
33+
uses: actions/upload-pages-artifact@v3
34+
with:
35+
path: build
36+
37+
deploy:
38+
needs: build
39+
runs-on: ubuntu-latest
40+
if: github.ref == 'refs/heads/main'
1341
permissions:
1442
pages: write
1543
id-token: write
44+
environment:
45+
name: github-pages
46+
url: ${{ steps.deployment.outputs.page_url }}
1647
steps:
17-
- id: deployment
18-
uses: sphinx-notes/pages@v3
48+
- name: Deploy to GitHub Pages
49+
id: deployment
50+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)