ci(docs): re-enable GitHub Pages deploy

Pages is now enabled on the repo (Settings → Pages → 'Build and
deployment: GitHub Actions'), so the workflow can use the standard
configure-pages → upload-pages-artifact → deploy-pages chain
without needing the GITHUB_TOKEN to enable Pages itself.

PR builds run the build job (catches mdbook breakage) but skip the
deploy job, so PRs don't republish the live site.
This commit is contained in:
2026-05-06 09:04:13 -06:00
parent af226e3d3b
commit d1288aa623
+23 -9
View File
@@ -10,6 +10,14 @@ on:
permissions: permissions:
contents: read contents: read
pages: write
id-token: write
# Only one Pages deploy at a time. Don't cancel a running deploy
# (otherwise we can leave the Pages site partially updated).
concurrency:
group: pages
cancel-in-progress: false
jobs: jobs:
build: build:
@@ -27,15 +35,21 @@ jobs:
run: | run: |
cd docs/book cd docs/book
mdbook build mdbook build
- name: Upload book as artifact - uses: actions/configure-pages@v5
uses: actions/upload-artifact@v4 - uses: actions/upload-pages-artifact@v3
with: with:
name: book
path: target/book path: target/book
if-no-files-found: error
retention-days: 14
# GitHub Pages deployment is intentionally not in this workflow. deploy:
# Once Pages is enabled on the repo (Settings → Pages → Build and name: Deploy to GitHub Pages
# deployment: GitHub Actions), this file can grow a `deploy` job # Only deploy on pushes to main / tag pushes / manual runs.
# using actions/configure-pages + actions/deploy-pages. # PR builds get the build-and-upload step but no deploy.
if: github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4