|
1 | 1 | # .github/workflows/deploy-docs.yml |
2 | 2 | name: Deploy Docs (on latest push to main branch) |
3 | 3 | # It builds and deploys the latest version of the documentation to GitHub Pages. |
4 | | -# IMPORTANT: Ensure Repo Settings / Pages / Build and deployment / Set Source to `GitHub Actions`. |
5 | | - |
| 4 | +# IMPORTANT: Ensure Repo Settings / Pages / Build and deployment / Set Source to `Deploy from a branch`, |
| 5 | +# and set Branch = `gh-pages`, Folder = `/`. |
| 6 | +# Note: mike manages dev/ and versioned docs on gh-pages branch. |
| 7 | +# |
6 | 8 | # CI PHASES A-B-C-D: |
7 | 9 | # - Assemble: Install dependencies, verify environment setup |
8 | 10 | # - Baseline: Core validation (types exist, lint passes, tests pass) |
|
15 | 17 | workflow_dispatch: |
16 | 18 |
|
17 | 19 | permissions: |
18 | | - contents: write # gh-pages deployment |
19 | | - pages: write |
20 | | - id-token: write |
| 20 | + contents: write # gh-pages deployment via mike |
21 | 21 |
|
22 | 22 | concurrency: |
23 | 23 | group: pages-${{ github.ref }} |
@@ -69,18 +69,14 @@ jobs: |
69 | 69 | - name: D1) Build docs (mkdocs --strict) |
70 | 70 | run: uv run mkdocs build --strict |
71 | 71 |
|
72 | | - - name: D2) Assert site artifact exists |
| 72 | + - name: D2) Configure git author for gh-pages pushes |
73 | 73 | run: | |
74 | | - test -d site && test -f site/index.html || { |
75 | | - echo "ERROR: MkDocs build produced no site/index.html" |
76 | | - exit 1 |
77 | | - } |
| 74 | + git config user.name "github-actions[bot]" |
| 75 | + git config user.email "github-actions[bot]@users.noreply.github.com" |
78 | 76 |
|
79 | | - - name: D3) Upload site as artifact |
80 | | - uses: actions/upload-pages-artifact@v4 |
81 | | - with: |
82 | | - path: ./site |
83 | | - |
84 | | - - name: D4) Deploy to GitHub Pages |
85 | | - id: deployment |
86 | | - uses: actions/deploy-pages@v4 |
| 77 | + - name: D3) Deploy dev channel with mike (keeps other versions) |
| 78 | + run: | |
| 79 | + # Publish the dev docs to gh-pages under /dev/ |
| 80 | + # If gh-pages does not exist yet, mike will create it on first push. |
| 81 | + uv run mike deploy --push --update-aliases dev |
| 82 | + # Do not set default here; release workflow will set 'latest' as default. |
0 commit comments