diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 352926f8..1596397b 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -20,15 +20,24 @@ jobs: run: cargo check --all - name: Run tests run: cargo test --all - - name: Build docs - run: cargo doc --no-deps - - name: Deploy docs to doc branch - run: | - git config --global user.name 'github-actions[bot]' - git config --global user.email 'github-actions[bot]@users.noreply.github.com' - git clone --branch=doc https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git doc - rsync -av target/doc/ doc/ - cd doc - git add --all - git commit -m 'Update documentation' - git push origin doc + doc: + name: Documentation + runs-on: ubuntu-latest + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + steps: + - uses: actions/checkout@v4 + - uses: KyleMayes/install-llvm-action@v1 + with: + version: ${{ env.DOC_LLVM_VERSION }} + - name: Install Rust Nightly + uses: dtolnay/rust-toolchain@nightly + - name: Build Documentation + run: cargo +nightly doc --features ${{ env.DOC_LLVM_FEATURE }},nightly --verbose --no-deps + - name: Doc Index Page Redirection + run: echo '' > ${{ env.DOC_PATH }}/index.html + - name: Deploy Documentation + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ${{ env.DOC_PATH }} + force_orphan: true