Skip to content

Commit 80d245b

Browse files
authored
Add workflow for automatically building sphinx documentation, resolves #3
Note that documentation is only built when pushed to `main`branch.
1 parent 7d50ba6 commit 80d245b

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/sphinx.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Build documentation
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
docs:
14+
runs-on: ubuntu-24.04
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- uses: mamba-org/setup-micromamba@v1
21+
with:
22+
micromamba-version: '2.0.5-0' # any version from https://github.com/mamba-org/micromamba-releases
23+
environment-file: environment.yml
24+
init-shell: bash
25+
cache-environment: true
26+
post-cleanup: 'all'
27+
generate-run-shell: false
28+
29+
- name: Sphinx build
30+
run: |
31+
sphinx-build doc _build
32+
shell: bash -el {0}
33+
34+
- name: Deploy to GitHub Pages
35+
uses: peaceiris/actions-gh-pages@v4
36+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
37+
with:
38+
publish_branch: gh-pages
39+
github_token: ${{ secrets.GITHUB_TOKEN }}
40+
publish_dir: _build/
41+
force_orphan: true

0 commit comments

Comments
 (0)