Skip to content

Commit fd2ac28

Browse files
自动构建工作流
1 parent bbfc211 commit fd2ac28

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/deploy_books.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Deploy knowledge_books
2+
3+
on:
4+
push:
5+
branches:
6+
- main # 或者你使用的其他主分支名
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Install mdBook
17+
run: |
18+
curl -sSL https://github.com/rust-lang/mdBook/releases/latest/download/mdbook-v0.4.36-x86_64-unknown-linux-gnu.tar.gz | tar -xz
19+
sudo mv mdbook /usr/local/bin
20+
21+
- name: Build the book
22+
working-directory: book_template
23+
run: mdbook build
24+
25+
- name: Deploy to GitHub Pages
26+
uses: peaceiris/actions-gh-pages@v4
27+
with:
28+
github_token: ${{ secrets.GITHUB_TOKEN }}
29+
publish_dir: publish_books/book_template
30+
publish_branch: gh-pages # 你想部署的分支
31+
cname: "yinghuochong" # 如果你使用自定义域名,可以填写

0 commit comments

Comments
 (0)