Skip to content
This repository was archived by the owner on Jul 5, 2025. It is now read-only.

Commit 0d3ca4b

Browse files
committed
patch
1 parent 90c40bf commit 0d3ca4b

File tree

1 file changed

+30
-10
lines changed

1 file changed

+30
-10
lines changed

.github/workflows/book.yml

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,20 @@ on:
66
push:
77
branches: main
88
paths: ['docs/**','.github/workflows/book.yml']
9+
workflow_dispatch:
10+
11+
permissions:
12+
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
concurrency:
18+
group: "pages"
19+
cancel-in-progress: false
920
jobs:
10-
deploy:
11-
name: Build and Deploy
21+
build:
22+
name: Build
1223
runs-on: ubuntu-20.04
1324
concurrency:
1425
group: ${{ github.workflow }}-${{ github.ref }}
@@ -25,6 +36,9 @@ jobs:
2536
~/.cargo/git/db/
2637
target/
2738
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
39+
- name: 🔨 Setup Pages
40+
id: pages
41+
uses: actions/configure-pages@v5
2842
- name: 🔨 Install mdbook
2943
uses: peaceiris/actions-mdbook@v1
3044
with:
@@ -37,12 +51,18 @@ jobs:
3751
- name: 🔨 Build Book
3852
run: mdbook build
3953
# working-directory: ./docs
40-
- name: 🌍 Deploy
41-
uses: peaceiris/actions-gh-pages@v3
42-
if: ${{ github.ref == 'refs/heads/main' }}
54+
- name: Upload artifact
55+
uses: actions/upload-pages-artifact@v3
4356
with:
44-
github_token: ${{ secrets.GITHUB_TOKEN }}
45-
publish_branch: pages
46-
publish_dir: ./book
47-
# publish_dir: ./docs/book
48-
destination_dir: docs
57+
path: ./book
58+
deploy:
59+
name: Deploy
60+
environment:
61+
name: github-pages
62+
url: ${{ steps.deployment.outputs.page_url }}
63+
runs-on: ubuntu-latest
64+
needs: build
65+
steps:
66+
- name: Deploy to GitHub Pages
67+
id: deployment
68+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)