Skip to content

Commit af0711f

Browse files
committed
Add workflow for publishing docs
This is currently untested, so might not work
1 parent d57a97e commit af0711f

2 files changed

Lines changed: 42 additions & 2 deletions

File tree

.github/workflows/publish-docs.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Build and Publish Package Documentation to GitHub Pages
2+
3+
on:
4+
workflow_dispatch:
5+
6+
release:
7+
types: [created]
8+
9+
jobs:
10+
publishdocs:
11+
runs-on: ubuntu-latest
12+
environment:
13+
name: github-pages
14+
url: ${{ steps.deployment.outputs.page_url }}
15+
permissions:
16+
# required for actions/deploy-pages, which is used inside sphinx-notes/pages
17+
pages: write
18+
id-token: write
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v6
22+
- name: Setup Python
23+
uses: actions/setup-python@v6
24+
with:
25+
python-version: 3.12
26+
- name: Install dependencies
27+
# we're installing sphinx here (even though sphinx-notes/pages will also install it) so we can run sphinx-apidoc
28+
run: |
29+
pip install git+https://github.com/pyg-team/pyg_sphinx_theme.git
30+
pip install -U sphinx==9.1.0
31+
- name: Run sphinx-apidoc
32+
run: sphinx-apidoc --output-dir _api .. --separate --no-toc
33+
- name: Build and deploy to GitHub Pages
34+
id: deployment
35+
uses: sphinx-notes/pages@v3
36+
with:
37+
checkout: false # we're doing the checkout ourselves to have more control over how dependencies are installed
38+
python-version: 3.12
39+
sphinx-version: 9.1.0

docs/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
## Dependencies
44

55
Install sphinx and the PyG theme.
6-
We're going to ignore the fact that the PyG theme requires an extremely old version of Sphinx.
6+
We're going to ignore the fact that the PyG theme requires an extremely old version of Sphinx and install a newer version instead.
7+
The second install command will show some dependency conflicts because of that, but that shouldn't be a problem.
78

89
```
910
pip install git+https://github.com/pyg-team/pyg_sphinx_theme.git
10-
pip install -U sphinx
11+
pip install -U sphinx==9.1.0
1112
```
1213

1314

0 commit comments

Comments
 (0)