Skip to content

Commit 78fade3

Browse files
committed
try fix deploy workflow
1 parent d2c42d9 commit 78fade3

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

.github/workflows/gh-pages.yml

+21-9
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@ on:
77
pull_request:
88

99
jobs:
10-
deploy:
10+
build:
1111
runs-on: ubuntu-24.04
12-
concurrency:
13-
group: ${{ github.workflow }}-${{ github.ref }}
1412
steps:
15-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v4
1614

1715
- name: Setup mdBook
1816
uses: peaceiris/actions-mdbook@v2
@@ -21,9 +19,23 @@ jobs:
2119

2220
- run: mdbook build
2321

24-
- name: Deploy
25-
uses: peaceiris/actions-gh-pages@v3
26-
if: ${{ github.ref == 'refs/heads/main' }}
22+
- name: Upload static files as artifact
23+
id: deployment
24+
uses: actions/upload-pages-artifact@v3
2725
with:
28-
github_token: ${{ secrets.GITHUB_TOKEN }}
29-
publish_dir: ./book
26+
path: ./book/
27+
28+
deploy:
29+
environment:
30+
name: github-pages
31+
url: ${{ steps.deployment.outputs.page_url }}
32+
permissions:
33+
pages: write # to deploy to Pages
34+
id-token: write # to verify the deployment originates from an appropriate source
35+
runs-on: ubuntu-latest
36+
needs: build
37+
steps:
38+
- name: Deploy to GitHub Pages
39+
id: deployment
40+
if: ${{ github.ref == 'refs/heads/main' }}
41+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)