diff --git a/.github/workflows/deploy-docs-pages.yml b/.github/workflows/deploy-docs-pages.yml new file mode 100644 index 000000000..09ecd2d35 --- /dev/null +++ b/.github/workflows/deploy-docs-pages.yml @@ -0,0 +1,78 @@ +name: Deploy documentation to GitHub Pages + +on: + push: + branches: + - main + paths: + - .github/workflows/deploy-docs-pages.yml + - .readthedocs.yaml + - docs/** + - lib/include/** + pull_request: + paths: + - .github/workflows/deploy-docs-pages.yml + - .readthedocs.yaml + - docs/** + - lib/include/** + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: github-pages + cancel-in-progress: false + +jobs: + build: + name: Build documentation + runs-on: ubuntu-24.04 + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install --yes doxygen graphviz + + - name: Install Python dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -r docs/public/requirements.txt + + - name: Build Sphinx documentation + run: python -m sphinx -q -b html docs/public docs/public/_build/html + + - name: Upload Pages artifact + if: github.event_name != 'pull_request' + uses: actions/upload-pages-artifact@v3 + with: + path: docs/public/_build/html + + deploy: + name: Deploy documentation + if: github.event_name != 'pull_request' + needs: build + runs-on: ubuntu-24.04 + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + steps: + - name: Configure GitHub Pages + uses: actions/configure-pages@v5 + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4