Skip to content

Commit 6f4b991

Browse files
committed
ci: update book.yml
1 parent 2eb6561 commit 6f4b991

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

.github/workflows/book.yml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,26 @@ on:
66
- 'book/**'
77
workflow_dispatch:
88

9+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
910
permissions:
10-
contents: write
11-
actions: read
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
16+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
17+
concurrency:
18+
group: "pages"
19+
cancel-in-progress: false
1220

1321
jobs:
1422
deploy:
1523
name: Deploy book
1624
if: github.ref == 'refs/heads/master'
25+
environment:
26+
name: github-pages
27+
url: ${{ steps.deployment.outputs.page_url }}
1728
runs-on: ubuntu-latest
18-
concurrency:
19-
group: ${{ github.workflow }}-${{ github.ref }}
2029
steps:
2130
- name: Checkout
2231
uses: actions/checkout@v3
@@ -27,12 +36,11 @@ jobs:
2736
- name: Build
2837
run: cd book && make build
2938

30-
- name: Setup Pages
31-
uses: actions/configure-pages@v4
32-
33-
- name: Deploy
34-
uses: peaceiris/actions-gh-pages@v3
35-
if: ${{ github.ref == 'refs/heads/master' }}
39+
- name: Upload artifact
40+
uses: actions/upload-pages-artifact@v2
3641
with:
37-
github_token: ${{ secrets.GITHUB_TOKEN }}
38-
publish_dir: ./book/book
42+
path: './book/book'
43+
44+
- name: Deploy to GitHub Pages
45+
id: deployment
46+
uses: actions/deploy-pages@v3

0 commit comments

Comments
 (0)