fix site-url #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Book and Examples | |
on: | |
push: | |
pull_request: | |
# just to make sure examples are up to date and still working | |
schedule: | |
- cron: "39 13 * * 1" | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
# Check all the examples | |
examples: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: nightly | |
override: true | |
- name: install cargo examples | |
run: cargo install cargo-examples | |
- name: run every example | |
run: | | |
cd halo-hero | |
cargo examples | |
# Build the book | |
book: | |
runs-on: ubuntu-latest | |
needs: examples | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
override: true | |
- name: install mdbook | |
run: cargo install mdbook | |
- name: install mdbook-admonish | |
run: | | |
cargo install mdbook-admonish | |
mdbook-admonish install | |
- name: build book | |
run: mdbook build | |
- name: Setup Pages | |
id: pages | |
uses: actions/configure-pages@v5 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./book | |
# Deployment job | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: book | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |