-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from Zhu-J-J/main
add github aciton 、update readme
- Loading branch information
Showing
4 changed files
with
107 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Build GitBook | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # 触发条件:当代码推送到 main 分支时触发 | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest # 使用最新版本的 Ubuntu | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 # 检出代码仓库 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 10.24.1 # 指定 Node.js 版本 | ||
|
||
- name: Install GitBook | ||
run: | | ||
npm install -g gitbook-cli # 安装 GitBook CLI | ||
gitbook install # 安装 GitBook 插件和依赖 | ||
- name: Build GitBook | ||
run: | | ||
gitbook build # 构建 GitBook 项目 | ||
# 如果需要生成静态 HTML 网站,可以使用 "gitbook build" 命令 | ||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 # 使用部署到 GitHub Pages 的 Action | ||
with: | ||
personal_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./_book # 需要发布的目录,这里是 GitBook 构建输出目录 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters