|
45 | 45 | - name: Install dependencies (with docs extras) |
46 | 46 | run: uv sync --extra docs |
47 | 47 |
|
48 | | - # ── Sphinx build ─────────────────────────────────────────────────────── |
49 | | - # -W turns warnings into errors so broken cross-references are caught. |
50 | | - # Remove -W if the gallery examples produce unavoidable warnings. |
51 | | - - name: Build HTML documentation |
52 | | - run: | |
53 | | - uv run sphinx-build -b html docs build/html -W --keep-going |
54 | | -
|
55 | 48 | # ── Determine deployment target ───────────────────────────────────────── |
56 | 49 | # Release tag (refs/tags/v1.2.3) → destination = "v1.2.3" |
57 | 50 | # Everything else (push to main, manual dispatch) → destination = "dev" |
|
65 | 58 | echo "dest_dir=dev" >> "$GITHUB_OUTPUT" |
66 | 59 | fi |
67 | 60 |
|
| 61 | + # ── Sphinx build ─────────────────────────────────────────────────────── |
| 62 | + # -W turns warnings into errors so broken cross-references are caught. |
| 63 | + # Remove -W if the gallery examples produce unavoidable warnings. |
| 64 | + - name: Build HTML documentation |
| 65 | + env: |
| 66 | + DOCS_VERSION: ${{ steps.target.outputs.dest_dir }} |
| 67 | + run: | |
| 68 | + uv run sphinx-build -b html docs build/html -W --keep-going |
| 69 | +
|
68 | 70 | # ── Deploy to gh-pages ──────────────────────────────────────────────── |
69 | 71 | # keep_files: true preserves all existing directories on the branch so |
70 | 72 | # versioned releases accumulate rather than overwriting each other. |
|
80 | 82 | commit_message: | |
81 | 83 | docs: deploy ${{ steps.target.outputs.dest_dir }} @ ${{ github.sha }} |
82 | 84 |
|
| 85 | + # ── Deploy root files (redirect + switcher) ──────────────────────────── |
| 86 | + # Places index.html and switcher.json at the root of gh-pages so the |
| 87 | + # bare URL redirects to dev/ and the version switcher is always reachable. |
| 88 | + - name: Deploy root redirect and switcher |
| 89 | + uses: peaceiris/actions-gh-pages@v4 |
| 90 | + with: |
| 91 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 92 | + publish_dir: ./docs/_root |
| 93 | + destination_dir: . |
| 94 | + keep_files: true |
| 95 | + commit_message: | |
| 96 | + docs: update root redirect and switcher.json @ ${{ github.sha }} |
| 97 | +
|
0 commit comments