Skip to content

Commit 687d813

Browse files
Refactor documentation workflow to use Poetry and improve GitHub Pages deployment
- Switch to Poetry for dependency management - Update Python actions to latest versions - Simplify workflow configuration - Improve documentation build process - Remove redundant configuration steps
1 parent 29c3f3c commit 687d813

File tree

1 file changed

+17
-21
lines changed

1 file changed

+17
-21
lines changed

.github/workflows/docs.yml

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
name: Documentation
1+
name: Deploy Documentation
22

33
on:
44
push:
5-
branches: [ main ]
6-
pull_request:
7-
types: [opened, synchronize, reopened]
8-
branches: [ main ]
9-
workflow_dispatch:
5+
branches:
6+
- main # or your default branch
7+
workflow_dispatch: # Allows manual triggering
108

9+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1110
permissions:
1211
contents: read
1312
pages: write
1413
id-token: write
1514

15+
# Allow only one concurrent deployment
1616
concurrency:
1717
group: "pages"
1818
cancel-in-progress: false
@@ -21,42 +21,38 @@ jobs:
2121
build:
2222
runs-on: ubuntu-latest
2323
steps:
24-
- uses: actions/checkout@v4
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
2526

2627
- name: Set up Python
27-
uses: actions/setup-python@v4
28+
uses: actions/setup-python@v5
2829
with:
29-
python-version: '3.10'
30+
python-version: '3.10' # or your preferred version
3031
cache: 'pip'
3132

3233
- name: Install dependencies
3334
run: |
3435
python -m pip install --upgrade pip
35-
pip install -e .
36-
pip install sphinx sphinx-rtd-theme sphinx-copybutton sphinx-design myst-parser
36+
pip install poetry
37+
poetry install
3738
3839
- name: Build documentation
39-
working-directory: docs
4040
run: |
41-
# Don't treat warnings as errors
42-
SPHINXOPTS="-n" make html
43-
44-
- name: Setup Pages
45-
uses: actions/configure-pages@v4
41+
cd docs
42+
poetry run make html
4643
4744
- name: Upload artifact
4845
uses: actions/upload-pages-artifact@v3
4946
with:
5047
path: docs/_build/html
5148

5249
deploy:
53-
needs: build
54-
if: github.ref == 'refs/heads/main'
55-
runs-on: ubuntu-latest
5650
environment:
5751
name: github-pages
5852
url: ${{ steps.deployment.outputs.page_url }}
53+
needs: build
54+
runs-on: ubuntu-latest
5955
steps:
6056
- name: Deploy to GitHub Pages
6157
id: deployment
62-
uses: actions/deploy-pages@v3
58+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)