Skip to content

Build docs

Build docs #3

Workflow file for this run

# This action runs on merging of PR to main.
#
# Workflow steps:
# - checkout gh-pages for updating
# - build sphinx docs/site
# - publish new docs to gh-pages
name: Build docs
on:
push:
branches:
- main
paths:
- 'docs/**'
- '*.md'
workflow_dispatch:
env:
PIP_DISABLE_PIP_VERSION_CHECK: "1"
PIP_PROGRESS_BAR: "off"
LOGLEVEL: "DEBUG"
jobs:
build:
name: Build documentation for gh-pages
permissions:
# Required for peaceiris/actions-gh-pages below
contents: write
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
with:
# Using fetch-depth 0 is the only way to get all tags which are needed for building docs.
fetch-depth: 0
- name: Checkout gh-pages branch to dir publish/
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
with:
ref: gh-pages
path: publish
fetch-depth: 1
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548
with:
python-version: '3.13'
- name: Install dependencies
run: |
python -VV
python -m pip install --upgrade pip
# install tagged version
python -m pip install .[docs]
- name: Build Sphinx documentation (website)
run: |
sphinx-build -b html --nitpicky --fail-on-warning --keep-going docs docs/_build/html
- uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b
with:
path: 'docs/_build/html'
- name: Deploy updated gh-pages content
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main'