Fix and update CI #18
Workflow file for this run
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Install Python dependencies | |
| run: | | |
| pip3 install --user python-dateutil linkchecker | |
| - name: Put pip binary directory into path | |
| run: echo "~/.local/bin" >> $GITHUB_PATH | |
| - name: Cache Cargo installed binaries | |
| uses: actions/cache@v4 | |
| id: cache-cargo | |
| with: | |
| path: ~/cargo-bin | |
| key: cache-cargo | |
| - name: Install mdbook | |
| if: steps.cache-cargo.outputs.cache-hit != 'true' | |
| run: cargo install mdbook | |
| - name: Copy mdbook to cache directory | |
| if: steps.cache-cargo.outputs.cache-hit != 'true' | |
| run: | | |
| mkdir ~/cargo-bin | |
| cp ~/.cargo/bin/mdbook ~/cargo-bin | |
| - name: Put new cargo binary directory into path | |
| run: echo "~/cargo-bin" >> $GITHUB_PATH | |
| - name: Build site | |
| run: cargo run | |
| - name: Check links | |
| run: linkchecker public | |
| - name: Deploy book | |
| if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: public | |
| force_orphan: true | |
| cname: showcase.rust-embedded.org |