| 1 | on: |
| 2 | push: |
| 3 | branches: |
| 4 | - main |
| 5 | |
| 6 | name: Docs |
| 7 | |
| 8 | jobs: |
| 9 | docs: |
| 10 | name: Build and deploy documentation |
| 11 | concurrency: ci-${{ github.ref }} |
| 12 | runs-on: ubuntu-latest |
| 13 | steps: |
| 14 | - uses: actions/checkout@v3 |
| 15 | - uses: dtolnay/rust-toolchain@stable |
| 16 | - name: Update Cargo.lock |
| 17 | run: cargo update |
| 18 | - uses: Swatinem/rust-cache@v2 |
| 19 | - name: Build rustdoc |
| 20 | run: cargo doc --all-features |
| 21 | env: |
| 22 | RUSTC_BOOTSTRAP: 1 |
| 23 | RUSTDOCFLAGS: --cfg=doc_cfg |
| 24 | - name: Organize |
| 25 | run: | |
| 26 | rm -rf target/gh-pages |
| 27 | mkdir target/gh-pages |
| 28 | mv target/doc target/gh-pages/rustdoc |
| 29 | touch target/gh-pages/.nojekyll |
| 30 | - name: Deploy |
| 31 | uses: JamesIves/github-pages-deploy-action@releases/v4 |
| 32 | with: |
| 33 | branch: gh-pages |
| 34 | folder: target/gh-pages |
| 35 | single-commit: true |