Files
heuropt/.github/workflows/docs.yml
T
swaits ae1daf687d ci(docs): auto-enable GitHub Pages on first run
The Docs workflow was failing on `actions/configure-pages@v5` with
"Get Pages site failed" because Pages isn't enabled on the repo
yet. Setting `enablement: true` lets the action auto-enable it so
the deploy can proceed without a manual Settings → Pages click.
2026-05-06 08:18:23 -06:00

53 lines
1.2 KiB
YAML

name: Docs
on:
push:
branches: [main]
tags: ["v*.*.*"]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
name: Build mdbook
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install mdbook
run: |
mkdir -p ~/.local/bin
curl -sSL "https://github.com/rust-lang/mdBook/releases/download/v0.4.40/mdbook-v0.4.40-x86_64-unknown-linux-musl.tar.gz" \
| tar -xz -C ~/.local/bin
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Build
run: |
cd docs/book
mdbook build
- uses: actions/configure-pages@v5
with:
# Auto-enable Pages on the repo if not already configured.
# Without this, the action errors with "Get Pages site failed".
enablement: true
- uses: actions/upload-pages-artifact@v3
with:
path: target/book
deploy:
name: Deploy to GitHub Pages
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4