Merge pull request #112 from underworldcode/dependabot/github_actions… #98
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: API docs / pdoc3 | |
# We should trigger this from an upload event | |
on: | |
push: # This is not really a great idea | |
branches: | |
- master | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools wheel twine | |
pip install numpy | |
pip install scipy | |
pip install Cython | |
pip install pdoc3 | |
pip install pytest | |
- name: Install latest stripy | |
run: | | |
pip install . | |
- name: Build docs with pdoc | |
shell: bash -l {0} | |
run: | | |
VERSION=`python -c "from importlib.metadata import version; print(version('stripy'))"` | |
echo "VERSION=$(echo $VERSION)" >> $GITHUB_ENV | |
mkdir -p docs | |
cd docs | |
pdoc --config latex_math=True --html -o api --force stripy | |
# Here we can add an action to build the jupyter book to a different directory | |
# and then they can be uploaded together. The jupyter book can contain a link to the | |
# API docs. | |
# Note deploy key needs the ----BEGIN ... KEY---- lines too | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
destination_dir: docs/ | |
publish_dir: docs/api/stripy |