Skip to content

Commit b7fb86f

Browse files
committed
ci: Build on push
1 parent d62977d commit b7fb86f

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

.github/workflows/deploy.yml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,60 @@
1-
# Sample workflow for building and deploying a VitePress site to GitHub Pages
1+
# 构建 VitePress 站点并将其部署到 GitHub Pages 的示例工作流程
22
#
33
name: Deploy VitePress site to Pages
44

55
on:
6-
# Runs on pushes targeting the `main` branch. Change this to `master` if you're
7-
# using the `master` branch as the default branch.
8-
# push:
9-
# branches: [main]
6+
# 在针对 `main` 分支的推送上运行。如果你
7+
# 使用 `master` 分支作为默认分支,请将其更改为 `master`
8+
push:
9+
branches: [main]
1010

11-
# Allows you to run this workflow manually from the Actions tab
11+
# 允许你从 Actions 选项卡手动运行此工作流程
1212
workflow_dispatch:
1313

14-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
14+
# 设置 GITHUB_TOKEN 的权限,以允许部署到 GitHub Pages
1515
permissions:
1616
contents: read
1717
pages: write
1818
id-token: write
1919

20-
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
21-
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20+
# 只允许同时进行一次部署,跳过正在运行和最新队列之间的运行队列
21+
# 但是,不要取消正在进行的运行,因为我们希望允许这些生产部署完成
2222
concurrency:
2323
group: pages
2424
cancel-in-progress: false
2525

2626
jobs:
27-
# Build job
27+
# 构建工作
2828
build:
2929
runs-on: ubuntu-latest
3030
steps:
3131
- name: Checkout
32-
uses: actions/checkout@v3
32+
uses: actions/checkout@v4
3333
with:
34-
fetch-depth: 0 # Not needed if lastUpdated is not enabled
35-
- uses: pnpm/action-setup@v2 # Uncomment this if you're using pnpm
34+
fetch-depth: 0 # 如果未启用 lastUpdated,则不需要
35+
- uses: pnpm/action-setup@v3 # 如果使用 pnpm,请取消注释
3636
with:
37-
version: 8
38-
# - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun
37+
version: 9
38+
# - uses: oven-sh/setup-bun@v1 # 如果使用 Bun,请取消注释
3939
- name: Setup Node
40-
uses: actions/setup-node@v3
40+
uses: actions/setup-node@v4
4141
with:
42-
node-version: 18
43-
cache: pnpm # or pnpm / yarn
42+
node-version: 20
43+
cache: pnpm # pnpm / yarn
4444
- name: Setup Pages
45-
uses: actions/configure-pages@v3
45+
uses: actions/configure-pages@v4
4646
- name: Install dependencies
47-
run: pnpm install # or pnpm install / yarn install / bun install
47+
run: pnpm install # pnpm install / yarn install / bun install
4848
- name: Build with VitePress
4949
run: |
50-
pnpm run build # or pnpm build / yarn build / bun run build
50+
pnpm run build # pnpm docs:build / yarn docs:build / bun run docs:build
5151
touch .vitepress/dist/.nojekyll
5252
- name: Upload artifact
53-
uses: actions/upload-pages-artifact@v2
53+
uses: actions/upload-pages-artifact@v3
5454
with:
5555
path: .vitepress/dist
5656

57-
# Deployment job
57+
# 部署工作
5858
deploy:
5959
environment:
6060
name: github-pages
@@ -65,4 +65,4 @@ jobs:
6565
steps:
6666
- name: Deploy to GitHub Pages
6767
id: deployment
68-
uses: actions/deploy-pages@v2
68+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)