Skip to content

Commit 71a223d

Browse files
authored
ci: use actions/* directly for deploying rustdocs (#11454)
1 parent df5cb92 commit 71a223d

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

.github/workflows/test.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,29 @@ jobs:
3434
run: cargo doc --workspace --all-features --no-deps --document-private-items
3535
env:
3636
RUSTDOCFLAGS: --cfg docsrs -D warnings --show-type-layout --generate-link-to-definition --enable-index-page -Zunstable-options
37-
- name: Deploy documentation
38-
uses: peaceiris/actions-gh-pages@v3
39-
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
37+
- name: Setup Pages
38+
uses: actions/configure-pages@v5
39+
- name: Upload artifact
40+
uses: actions/upload-pages-artifact@v3
4041
with:
41-
github_token: ${{ secrets.GITHUB_TOKEN }}
42-
publish_dir: target/doc
42+
path: ./target/doc
43+
44+
deploy-docs:
45+
if: github.ref_name == 'main' && github.event_name == 'push'
46+
runs-on: ubuntu-latest
47+
needs: [docs]
48+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
49+
permissions:
50+
pages: write
51+
id-token: write
52+
environment:
53+
name: github-pages
54+
url: ${{ steps.deployment.outputs.page_url }}
55+
timeout-minutes: 30
56+
steps:
57+
- name: Deploy to GitHub Pages
58+
id: deployment
59+
uses: actions/deploy-pages@v4
4360

4461
doctest:
4562
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)