diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a3d61314..77bc4986 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -2,41 +2,65 @@ name: Docs on: push: - branches: ["main"] + branches: + - main + pull_request: - branches: ["main"] + branches: + - main + + workflow_dispatch: permissions: contents: read - pages: write - id-token: write + +concurrency: + group: github-pages + cancel-in-progress: false jobs: build: runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Configure GitHub Pages + uses: actions/configure-pages@v5 + - name: Install uv - uses: astral-sh/setup-uv@v5 + uses: astral-sh/setup-uv@v8 with: enable-cache: true python-version: "3.14t" + - name: Install dependencies run: uv sync --frozen --group docs - - name: Build docs - run: uv run sphinx-build docs/source docs/_build/html - - name: Upload pages artifact - uses: actions/upload-pages-artifact@v3 + + - name: Build documentation + run: uv run sphinx-build -W docs/source docs/_build/html + + - name: Upload Pages artifact + if: github.event_name != 'pull_request' + uses: actions/upload-pages-artifact@v4 with: path: docs/_build/html deploy: + if: github.event_name != 'pull_request' needs: build runs-on: ubuntu-latest + + permissions: + pages: write + id-token: write + environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} + steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 \ No newline at end of file + uses: actions/deploy-pages@v5