From cd453bd6247aec0fbea493d4e2748ccaa20aef63 Mon Sep 17 00:00:00 2001 From: Frederic Samier Date: Thu, 6 Aug 2026 15:24:11 +0200 Subject: [PATCH] Build docs on every PR, deploy only on push to main --- .github/workflows/ci.yml | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e0e2a89..09621196 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,21 +73,14 @@ jobs: path: tests/.tests.xml include-hidden-files: true + # Build docs on every PR to catch errors early (no artifact upload). - name: Build docs timeout-minutes: 10 if: ${{ !cancelled() }} run: pdm run docs - - name: Upload docs artifact - timeout-minutes: 10 - if: ${{ !cancelled() && github.event_name == 'push' && github.ref == 'refs/heads/main' }} - uses: actions/upload-artifact@v7 - with: - name: docs-build - path: "./docs/build" - # ────────────────────────────────────────────────────────────────── - # Deploy docs — only on push to main + # Build & deploy docs — only on push to main # ────────────────────────────────────────────────────────────────── deploy-docs: name: deploy docs @@ -95,16 +88,32 @@ jobs: needs: ci runs-on: ubuntu-latest timeout-minutes: 30 + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} permissions: + contents: read pages: write id-token: write steps: - - name: Download docs artifact + - name: Checkout timeout-minutes: 10 - uses: actions/download-artifact@v8 + uses: actions/checkout@v7 with: - name: docs-build - path: "./docs/build" + fetch-depth: 0 + submodules: "recursive" + + - name: Setup mise + timeout-minutes: 10 + uses: jdx/mise-action@v4.2.3 + + - name: Install dependencies + timeout-minutes: 10 + run: pdm install --dev --check --frozen-lockfile + + - name: Build docs + timeout-minutes: 10 + run: pdm run docs - name: Setup Github Pages timeout-minutes: 10 @@ -117,5 +126,6 @@ jobs: path: "./docs/build" - name: Deploy GitHub Pages + id: deployment timeout-minutes: 10 uses: actions/deploy-pages@v5