Skip to content

Build Book and Examples #13

Build Book and Examples

Build Book and Examples #13

Workflow file for this run

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