Skip to content

Build docs

Build docs #8

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
#
# passes all zizmor --nitpicky checks (zizmor 1.19.0)
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"
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build documentation for gh-pages
permissions:
contents: read
runs-on: ubuntu-latest
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
persist-credentials: false
- 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'
publish:
name: Publish documentation on gh-pages
needs: build
permissions:
id-token: write # to verify the deployment originates from an trusted source
pages: write # to write to gh-pages branch
contents: read
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- 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'