-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (47 loc) · 1.34 KB
/
documentation.yml
File metadata and controls
49 lines (47 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: documentation
on:
push:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
doctest:
name: Test if documentation can be rendered
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install package and sphinx
run: |
pip install .
pip install sphinx>=4.5 sphinx-book-theme pytest sphinx_gallery plotly
sphinx-build -b doctest doc .
docdeploy:
name: Render the documentation and push it to gh-pages
runs-on: ubuntu-latest
needs: doctest
if: ${{github.ref == 'refs/heads/main'}}
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install package and sphinx
run: |
pip install .
pip install sphinx>=4.5 sphinx-book-theme pytest sphinx_gallery plotly
- name: Sphinx build
run: |
sphinx-build doc _build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build/
force_orphan: true