Add cargo fmt to CI #138
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
# On Repository Settings > Pages > Build and deployment | |
# Set "Source" to GitHub Actions. | |
name: Documentation | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
jobs: | |
mdbook_test: | |
name: Test mdBook Documentation builds | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install mdBook | |
run: | | |
cargo install mdbook --no-default-features --features search --vers "^0.4" --locked | |
- name: Test mdBook | |
run: mdbook test | |
mdbook_publish: | |
if: ${{ github.event_name != 'pull_request' }} | |
needs: mdbook_test | |
permissions: | |
pages: write | |
contents: write | |
id-token: write | |
name: Publish mdBook to Github Pages | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install mdBook | |
run: | | |
cargo install mdbook --no-default-features --features search --vers "^0.4" --locked | |
- name: Build mdBook | |
run: mdbook build | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: book | |
- name: Deploy to Github Pages | |
uses: actions/deploy-pages@v4 |