File tree Expand file tree Collapse file tree 2 files changed +11
-89
lines changed
Expand file tree Collapse file tree 2 files changed +11
-89
lines changed Original file line number Diff line number Diff line change 1- # 构建 VitePress 站点并将其部署到 GitHub Pages 的示例工作流程
2- #
31name : Deploy VitePress site to Pages
42
53on :
6- # 在针对 `main` 分支的推送上运行。如果你
7- # 使用 `master` 分支作为默认分支,请将其更改为 `master`
84 push :
95 branches : [main]
10-
11- # 允许你从 Actions 选项卡手动运行此工作流程
126 workflow_dispatch :
137
14- # 设置 GITHUB_TOKEN 的权限,以允许部署到 GitHub Pages
158permissions :
169 contents : read
1710 pages : write
1811 id-token : write
1912
20- # 只允许同时进行一次部署,跳过正在运行和最新队列之间的运行队列
21- # 但是,不要取消正在进行的运行,因为我们希望允许这些生产部署完成
2213concurrency :
2314 group : pages
2415 cancel-in-progress : false
2516
2617jobs :
27- # 构建工作
2818 build :
2919 runs-on : ubuntu-latest
3020 steps :
3121 - name : Checkout
3222 uses : actions/checkout@v4
33- with :
34- fetch-depth : 0 # 如果未启用 lastUpdated,则不需要
35- # - uses: pnpm/action-setup@v3 # 如果使用 pnpm,请取消此区域注释
36- # with:
37- # version: 9
38- # - uses: oven-sh/setup-bun@v1 # 如果使用 Bun,请取消注释
23+
3924 - name : Setup Node
4025 uses : actions/setup-node@v4
4126 with :
4227 node-version : 22
43- cache : bun # 或 pnpm / yarn
44- - name : Setup Pages
45- uses : actions/configure-pages@v4
28+
29+ - name : Setup Bun
30+ uses : oven-sh/setup-bun@v1
31+ with :
32+ bun-version : latest
33+
4634 - name : Install dependencies
47- run : bun install # 或 pnpm install / yarn install / bun install
35+ run : bun install
36+
4837 - name : Build with VitePress
49- run : bun run docs:build # 或 pnpm docs:build / yarn docs:build / bun run docs:build
38+ run : bun run docs:build
39+
5040 - name : Upload artifact
5141 uses : actions/upload-pages-artifact@v3
5242 with :
5343 path : docs/.vitepress/dist
5444
55- # 部署工作
5645 deploy :
5746 environment :
5847 name : github-pages
5948 url : ${{ steps.deployment.outputs.page_url }}
6049 needs : build
6150 runs-on : ubuntu-latest
62- name : Deploy
6351 steps :
6452 - name : Deploy to GitHub Pages
6553 id : deployment
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments