-
-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
0 additions
and
50 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 |
---|---|---|
@@ -1,51 +1 @@ | ||
name: Deploy Docs to GitHub Pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- master # 更换为您的主要分支名称,如果您使用的是其他主要分支,请相应修改 | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
# steps: | ||
# - name: Checkout code | ||
# uses: actions/checkout@v2 | ||
|
||
# - name: Setup Node.js | ||
# uses: actions/setup-node@v2 | ||
# with: | ||
# node-version: '14' # 可根据您的项目需要修改Node.js版本 | ||
|
||
steps: | ||
# 下载仓库代码 / 校验 | ||
- name: Checkout | ||
# actions/checkout@v3 是 github 官方的一个action,用于 clone 该仓库的源码到工作流中 | ||
uses: actions/checkout@v3 | ||
|
||
# 安装 pnpm | ||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 7.17.1 | ||
|
||
# 安装 node | ||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16.x' | ||
cache: 'pnpm' | ||
|
||
- name: Install dependencies | ||
run: pnpm i # 执行安装依赖,如果您的项目中使用的是 npm,请将 "pnpm i" 替换为 "npm install" | ||
|
||
- name: Build Docs | ||
run: pnpm run build:docs # 执行打包文档命令,如果您的项目中使用的是 npm,请将 "pnpm run build:docs" 替换为 "npm run build:docs" | ||
|
||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} # 访问秘钥 | ||
publish_branch: gh-pages # 推送分支 | ||
publish_dir: docs/.vitepress/dist # 指定打包后的文档目录 |