-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (43 loc) · 1.33 KB
/
deploy-site.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Deploy Site
on:
push:
branches: [main] # 触发当前事件分支
paths:
- 'packages/**' # 触发当前事件路径
workflow_dispatch:
# 定义了一个或多个 jobs(工作)
jobs:
# 定义了一个名为 build-and-deploy 的 job
build-and-deploy:
# 定义了 job 的运行环境
runs-on: ubuntu-latest
# 定义了 job 的执行步骤
steps:
# 检出代码
- name: Checkout 🛎️
uses: actions/checkout@v4
with:
ref: 'main'
# 启用 Corepack 来安装 pnpm。Corepack 是一种用于 Node.js 生态系统的包管理器。
- name: Install pnpm
run: corepack enable
# 设置 node 版本
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'pnpm'
# 安装依赖
- name: Install dependencies
run: pnpm install
# 打包构建站点
- name: Build Site
run: npm run build:site
# 部署站点
- name: Deploy for GitHub 🚀
uses: JamesIves/github-pages-deploy-action@v4.4.1
with:
branch: gh-pages # 部署到 gh-pages 分支
folder: packages/vant/site-dist # 部署的文件夹
# 启用 single-commit 以减少回购规模
single-commit: true # 单次提交
clean: true # 清理