# Builds the MkDocs site and deploys it with GitHub's official Pages Actions # flow (build once -> upload artifact -> deploy). This avoids the gh-pages # branch entirely, so there is no force-push race and the custom domain set in # Settings persists across deploys. # # One-time setup: Settings -> Pages -> Source = "GitHub Actions". name: docs on: push: branches: [master] paths: - "docs/**" - "mkdocs.yml" - ".github/workflows/docs.yml" workflow_dispatch: permissions: contents: read pages: write id-token: write # Allow one Pages deployment at a time; queue (don't cancel) overlapping runs. concurrency: group: pages cancel-in-progress: false jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - name: Install uv uses: astral-sh/setup-uv@v7 - name: Build the site (strict) run: | uv sync --extra docs uv run mkdocs build --strict - name: Upload Pages artifact uses: actions/upload-pages-artifact@v3 with: path: site deploy: needs: build runs-on: ubuntu-latest environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} steps: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v5