-
Notifications
You must be signed in to change notification settings - Fork 8
58 lines (48 loc) · 1.66 KB
/
Copy pathdocs.yml
File metadata and controls
58 lines (48 loc) · 1.66 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
50
51
52
53
54
55
56
57
58
# Build the Sphinx docs and publish them to the gh-pages branch (the existing
# GitHub Pages source for https://geohang.github.io/PyHydroGeophysX/). Replaces
# the manual build_docs_windows.bat + ghp-import flow.
name: Docs
on:
push:
branches: [main]
paths:
- "docs/**"
- "PyHydroGeophysX/**"
- "examples/**"
- ".github/workflows/docs.yml"
workflow_dispatch:
permissions:
contents: write
concurrency:
group: docs-deploy
cancel-in-progress: true
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.11"
cache: pip
- name: Install the package and docs dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .
python -m pip install -r docs/requirements.txt
- name: Build the Sphinx site
# qt_apps is excluded from apidoc: the desktop GUI is documented as a
# user guide (agents/desktop_studio), not as API pages, and its
# PySide6 imports are not available on the docs runner.
run: |
sphinx-apidoc -f -o docs/source/api PyHydroGeophysX "PyHydroGeophysX/qt_apps"
sphinx-build -b html docs/source docs/build/html --keep-going
- name: Verify gallery output images
run: python tools/check_docs_images.py --require-build
- name: Publish to gh-pages
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/html
force_orphan: true