Skip to content

Commit 52f6453

Browse files
authored
Publish static Python documentation (#188)
1 parent e53e851 commit 52f6453

2 files changed

Lines changed: 50 additions & 5 deletions

File tree

.github/workflows/python-doc.yml

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,34 @@
11
name: Python documentation
22

33
on:
4-
pull_request:
4+
release:
5+
types: [created, published]
56
push:
67
branches: [ "main" ]
78
workflow_dispatch:
89

10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
concurrency:
16+
group: "pages"
17+
cancel-in-progress: false
18+
919
jobs:
10-
build:
11-
name: Build documentation
20+
deploy:
21+
environment:
22+
name: github-pages
23+
url: ${{ steps.deployment.outputs.page_url }}
1224
runs-on: ubuntu-latest
1325
steps:
14-
- name: Checkout sources
26+
- name: Checkout
1527
uses: actions/checkout@v4
1628

1729
- uses: prefix-dev/setup-pixi@v0.8.8
1830
with:
19-
pixi-version: v0.45.0
31+
pixi-version: v0.48.0
2032
cache: true
2133
frozen: true
2234

@@ -27,3 +39,15 @@ jobs:
2739
- name: Build HTML
2840
# Turn warning into errors
2941
run: SPHINXOPTS="-W --keep-going -n" pixi run -e docs python-docs
42+
43+
- name: Setup Pages
44+
uses: actions/configure-pages@v5
45+
46+
- name: Upload artifact
47+
uses: actions/upload-pages-artifact@v3
48+
with:
49+
path: 'docs/_build/html'
50+
51+
- name: Deploy to GitHub Pages
52+
id: deployment
53+
uses: actions/deploy-pages@v4

.github/workflows/python-test.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,24 @@ jobs:
6060
save-if: ${{ github.ref == 'refs/heads/main' }}
6161

6262
- run: pixi run -e test pytest
63+
64+
doc:
65+
name: Check documentation
66+
runs-on: ubuntu-latest
67+
steps:
68+
- name: Checkout sources
69+
uses: actions/checkout@v4
70+
71+
- uses: prefix-dev/setup-pixi@v0.8.8
72+
with:
73+
pixi-version: v0.48.0
74+
cache: true
75+
frozen: true
76+
77+
- uses: Swatinem/rust-cache@v2
78+
with:
79+
save-if: ${{ github.ref == 'refs/heads/main' }}
80+
81+
- name: Build HTML
82+
# Turn warning into errors
83+
run: SPHINXOPTS="-W --keep-going -n" pixi run -e docs python-docs

0 commit comments

Comments
 (0)