Update #82
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Sphinx-API Docs | |
on: [push, pull_request, workflow_dispatch] | |
permissions: | |
contents: write | |
jobs: | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout main | |
uses: actions/checkout@v4 | |
- name: Checkout discover utils | |
uses: actions/checkout@master | |
with: | |
repository: hcmlab/discover-utils | |
path: discover-utils | |
ref: refs/heads/main | |
- name: Checkout discover modules | |
uses: actions/checkout@master | |
with: | |
repository: hcmlab/discover-modules | |
path: docs/discover-modules | |
ref: refs/heads/main | |
- uses: actions/setup-python@v3 | |
- name: Install dependencies | |
run: | | |
pip install sphinx sphinx_rtd_theme myst-parser sphinx-argparse==0.5.2 sphinx-mdinclude | |
- name: Sphinx build | |
run: | | |
sphinx-apidoc -e -M -d 8 -o docs/docsource/api discover | |
sphinx-apidoc -e -M -d 8 -o docs/docsource/api discover-utils/discover_utils discover-utils/discover_utils/scripts/extract.py discover-utils/discover_utils/scripts/train.py discover-utils/discover_utils/scripts/predict.py | |
sphinx-build discover-utils/docs/docsource _build | |
sphinx-build docs/docsource _build | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
if: ${{ github.event_name == 'push' }} # && github.ref == 'refs/heads/main' }} | |
with: | |
publish_branch: gh-pages | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: _build/ | |
force_orphan: true |