Update project docs, add Sphinx docs pipeline (#14) #1
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: Docs | |
on: | |
push: | |
branches: [main] | |
workflow_dispatch: | |
env: | |
python-version: 3.11 | |
docs-build: docs/build/ | |
permissions: | |
contents: write | |
jobs: | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
# Fetches remote repository without --progress option. | |
# | |
# The default behavior of @actions/checkout outputs many noisy lines of | |
# status output in the workflow log, which is problematic for log size. | |
# | |
# Refer to the below PR for updates on this issue: | |
# - https://github.com/actions/checkout/pull/1067 | |
- name: Checkout latest repository commit | |
# uses: actions/checkout@v3 | |
uses: simonbaird/checkout@no-progress-option | |
with: | |
show-progress: false | |
# submodules: recursive | |
# Setup python virtual environment | |
- name: Install poetry | |
run: | | |
bash ci/scripts/lib/install-poetry.sh | |
echo "PATH=${HOME}/.poetry/bin:${PATH}" >> $GITHUB_ENV | |
- name: Setup Python ${{ env.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ env.python-version }} | |
cache: poetry | |
cache-dependency-path: poetry.lock | |
# Setup Poetry virtual environment | |
- name: Use matrix python version in Poetry virtualenv | |
run: | | |
poetry env use ${{ env.python-version }} | |
- name: Setup Poetry plugins and project dependencies | |
run: poetry install -n --with docs | |
# Build docs | |
- name: Sphinx build | |
run: | | |
poetry sphinx-build | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ${{ env.docs-build }} | |
publish_branch: gh-pages | |
force_orphan: true |