Merge pull request #11 from NotAShelf/dependabot/github_actions/actio… #43
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: Documentation | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: deploy | |
| cancel-in-progress: false | |
| jobs: | |
| rustdoc: | |
| name: Build API docs | |
| runs-on: ubuntu-latest | |
| env: | |
| RUST_BACKTRACE: 1 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Install Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Configure cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Setup pages | |
| id: pages | |
| uses: actions/configure-pages@v5 | |
| - name: Build Documentation | |
| run: | | |
| cargo clean --doc ; cargo doc --no-deps --workspace --all-features | |
| - name: Add redirect | |
| run: echo '<meta http-equiv="refresh" content="0;url=mrc/index.html">' > target/doc/index.html | |
| - name: Remove lock file | |
| run: rm target/doc/.lock | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: target/doc | |
| deploy: | |
| name: Deploy Documentation | |
| runs-on: ubuntu-latest | |
| needs: rustdoc | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |