name: Build Documentation

on:
  pull_request:
    branches:
      - master
  workflow_dispatch:

permissions: {}

jobs:
  build-documentation:
    runs-on: ubuntu-24.04
    steps:
      - uses: actions/checkout@v5.0.0
      - name: Install Python
        uses: actions/setup-python@v6.0.0
        with:
          cache: 'pip'
          check-latest: true
          python-version: '3.13.8'
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip setuptools wheel
          pip install -r requirements-docs.txt
      - name: Build documentation
        env:
          SPHINXOPTS: -T -W --keep-going
        run: make -C docs html
