Skip to content

Commit a1ce40e

Browse files
committed
add workflow to generate documentation
1 parent d641b32 commit a1ce40e

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed

.github/workflows/sphinx_doc.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Create Docs
2+
3+
on: [push]
4+
5+
jobs:
6+
build-sphinx:
7+
runs-on: ubuntu-latest
8+
steps:
9+
# TODO maybe in the future use reusable workflows or composite workflows
10+
# for this part here
11+
- name: Checkout sources
12+
uses: actions/checkout@v2
13+
with:
14+
submodules: recursive
15+
16+
- name: Install stable toolchain
17+
uses: actions-rs/toolchain@v1
18+
with:
19+
profile: minimal
20+
toolchain: stable
21+
override: true
22+
23+
- uses: actions/checkout@v4
24+
- name: Set up Python 3.x
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: 3.x
28+
29+
- name: create virtual environment
30+
run: |
31+
python3 -m venv .venv
32+
python3 -m pip install --upgrade pip
33+
source .venv/bin/activate
34+
python3 -m pip install -r requirements.txt
35+
36+
- name: Build wheels
37+
uses: PyO3/maturin-action@v1
38+
with:
39+
command: develop
40+
args: --release
41+
# Up until here!
42+
43+
- name: build cargo documentation in docs dir
44+
run: |
45+
cargo doc --no-deps --target-dir docs/build/html/rust_doc
46+
47+
- name: Install Doc Requirements
48+
run: |
49+
source .venv/bin/activate
50+
python3 -m pip install -r docs/requirements.txt
51+
52+
- name: Sphinx build
53+
run: |
54+
source .venv/bin/activate
55+
sphinx-build docs/source docs/build/html
56+
57+
- name: Upload Artifacts
58+
uses: actions/upload-pages-artifact@v3
59+
with:
60+
path: docs/build/html
61+
62+
deploy:
63+
environment:
64+
name: github-pages
65+
url: ${{ steps.deployment.outputs.page_url }}
66+
runs-on: ubuntu-latest
67+
needs: build-sphinx
68+
permissions:
69+
id-token: write
70+
pages: write
71+
if: github.ref == 'refs/heads/main'
72+
steps:
73+
- name: Deploy to GitHub Pages
74+
id: deployment
75+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)