fix(ci): sudo did not know where cargo lives #133
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: GitHub Pages | |
on: | |
workflow_dispatch: # Allow manual triggers | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: write | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup mdBook | |
uses: peaceiris/actions-mdbook@v1 | |
with: | |
mdbook-version: "latest" | |
- name: Install mdbook-linkcheck | |
run: | | |
wget -q https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/latest/download/mdbook-linkcheck.x86_64-unknown-linux-gnu.zip -O mdbook-linkcheck.zip &&\ | |
unzip -q mdbook-linkcheck.zip -d mdbook-linkcheck &&\ | |
chmod +x mdbook-linkcheck/mdbook-linkcheck &&\ | |
echo "$PWD/mdbook-linkcheck" >> $GITHUB_PATH | |
- name: Install mdbook-mermaid | |
run: | | |
wget -q https://github.com/badboy/mdbook-mermaid/releases/download/v0.12.6/mdbook-mermaid-v0.12.6-x86_64-unknown-linux-gnu.tar.gz -O mdbook-mermaid.tar.gz &&\ | |
mkdir mdbook-mermaid &&\ | |
tar -xzf mdbook-mermaid.tar.gz -C mdbook-mermaid &&\ | |
chmod +x mdbook-mermaid/mdbook-mermaid &&\ | |
echo "$PWD/mdbook-mermaid" >> $GITHUB_PATH | |
- name: Install mdbook-toc | |
run: | | |
wget -q https://github.com/badboy/mdbook-toc/releases/download/0.14.1/mdbook-toc-0.14.1-x86_64-unknown-linux-gnu.tar.gz -O mdbook-toc.tar.gz &&\ | |
mkdir mdbook-toc &&\ | |
tar -xzf mdbook-toc.tar.gz -C mdbook-toc &&\ | |
chmod +x mdbook-toc/mdbook-toc &&\ | |
echo "$PWD/mdbook-toc" >> $GITHUB_PATH | |
- name: setup | rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
default: true | |
profile: minimal | |
- name: Build mdbook | |
run: mdbook build | |
working-directory: ./guide | |
- name: Deploy mdbook | |
if: github.ref == 'refs/heads/main' | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./guide/book |