Update rust.yml #8
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: Deploy Rust Docs | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Generate Documentation | |
| run: cargo doc --no-deps --document-private-items | |
| - name: Create Root Redirect | |
| # This prevents the 404 by pointing the root to your crate's folder | |
| run: | | |
| echo '<meta http-equiv="refresh" content="0; url=web_server_made_rusty/index.html">' > target/doc/index.html | |
| - name: Fix Permissions | |
| run: chmod -v -R +rX "target/doc/" | |
| - name: Upload Artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: target/doc | |
| - name: Deploy to GitHub Pages | |
| uses: actions/deploy-pages@v4 |