Skip to content

Commit 07880e9

Browse files
committed
update GitHub Actions workflow for documentation build and deployment
1 parent e58eb44 commit 07880e9

1 file changed

Lines changed: 20 additions & 5 deletions

File tree

.github/workflows/docs.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,18 @@ on:
66
pull_request:
77
branches: [ main ]
88

9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
914
jobs:
1015
docs:
1116
name: Build Documentation
1217
runs-on: ubuntu-latest
18+
environment:
19+
name: github-pages
20+
url: ${{ steps.deployment.outputs.page_url }}
1321
steps:
1422
- uses: actions/checkout@v4
1523

@@ -28,10 +36,17 @@ jobs:
2836
- name: Build documentation
2937
run: cargo doc --all-features --no-deps
3038

31-
- name: Deploy to GitHub Pages
39+
- name: Setup Pages
40+
if: github.ref == 'refs/heads/main'
41+
uses: actions/configure-pages@v3
42+
43+
- name: Upload artifact
3244
if: github.ref == 'refs/heads/main'
33-
uses: peaceiris/actions-gh-pages@v3
45+
uses: actions/upload-pages-artifact@v2
3446
with:
35-
github_token: ${{ secrets.GITHUB_TOKEN }}
36-
publish_dir: ./target/doc
37-
destination_dir: docs
47+
path: ./target/doc
48+
49+
- name: Deploy to GitHub Pages
50+
if: github.ref == 'refs/heads/main'
51+
id: deployment
52+
uses: actions/deploy-pages@v2

0 commit comments

Comments
 (0)