diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 14cae58..4739a6a 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -8,6 +8,11 @@ on: pull_request: branches: [ main ] +permissions: + contents: read + pages: write + id-token: write + env: CARGO_TERM_COLOR: always @@ -15,6 +20,9 @@ jobs: docs: name: Documentation runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} steps: - uses: actions/checkout@v4 @@ -41,10 +49,17 @@ jobs: cargo deadlinks --check-http continue-on-error: true - - name: Deploy documentation to GitHub Pages + - name: Setup Pages + if: github.ref == 'refs/heads/main' + uses: actions/configure-pages@v4 + + - name: Upload artifact if: github.ref == 'refs/heads/main' - uses: peaceiris/actions-gh-pages@v3 + uses: actions/upload-pages-artifact@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./target/doc - force_orphan: true + path: ./target/doc + + - name: Deploy to GitHub Pages + if: github.ref == 'refs/heads/main' + id: deployment + uses: actions/deploy-pages@v4