Skip to content

Build and release docs #33

Build and release docs

Build and release docs #33

Workflow file for this run

name: Build and release docs
# build the documentation for all version branches on dispatch
on:
# only trigger manually or via API call
workflow_dispatch:
# security: restrict permissions for CI jobs.
permissions:
contents: read
jobs:
# Build documentation and upload static HTML files as an artifact
build:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
with:
fetch-depth: 0 # Needed to access all version branches
- name: Set Up Python
uses: actions/setup-python@v5
with:
python-version: ${{ vars.PYTHON_VERSION }}
# Poetry is needed for version management
- name: Install poetry
run: |
pipx install poetry
# Install dependencies and prerequisites for doc generation script
- run: |
python -m pip install --upgrade pip
pip install pdoc
# Generate docs into docs_output/
- name: Generate documentation
run: |
chmod +x ./build_docs.sh
./build_docs.sh
- uses: actions/upload-pages-artifact@v3
with:
path: docs_output/
# Deploy artifact to GitHub pages
# This is a separate job so that only actions/deploy-pages has the necessary permissions
deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4