chore: update outdated docs (#43) #91
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
# Build and deploy the book to GitHub Pages | |
name: book | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
merge_group: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: dtolnay/rust-toolchain@stable | |
- name: Install mdbook-external-links | |
run: cargo install mdbook-external-links | |
- name: Install mdbook | |
run: | | |
mkdir mdbook | |
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.37/mdbook-v0.4.37-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook | |
echo $(pwd)/mdbook >> $GITHUB_PATH | |
- name: Install mdbook-linkcheck | |
run: | | |
mkdir mdbook-linkcheck | |
curl -sSL -o mdbook-linkcheck.zip https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/latest/download/mdbook-linkcheck.x86_64-unknown-linux-gnu.zip | |
unzip mdbook-linkcheck.zip -d ./mdbook-linkcheck | |
chmod +x $(pwd)/mdbook-linkcheck/mdbook-linkcheck | |
echo $(pwd)/mdbook-linkcheck >> $GITHUB_PATH | |
- name: Run linkcheck | |
run: mdbook-linkcheck --standalone | |
- name: Run tests | |
run: mdbook test | |
- name: Build book | |
run: mdbook build | |
# Only prepare for deploy if a push to main | |
- name: Setup Pages | |
if: github.ref_name == 'main' && github.event_name == 'push' | |
uses: actions/configure-pages@v5 | |
# Only prepare for deploy if a push to main | |
- name: Upload artifact | |
if: github.ref_name == 'main' && github.event_name == 'push' | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: "book/html" | |
deploy: | |
# Only deploy if a push to main | |
if: github.ref_name == 'main' && github.event_name == 'push' | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
needs: [build] | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |