Skip to content

Commit 6ee3591

Browse files
author
Shanshui2024
committed
Update: 看看这一版行不行
Signed-off-by: Shanshui2024 <[email protected]>
1 parent 2d6c67a commit 6ee3591

File tree

1 file changed

+22
-13
lines changed

1 file changed

+22
-13
lines changed

.github/workflows/deploy.yml

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,50 @@ name: Deploy tldraw to GitHub Pages
22

33
on:
44
push:
5-
branches: [main] # 触发分支
5+
branches: [main]
66

77
jobs:
88
deploy:
99
runs-on: ubuntu-latest
1010
permissions:
11-
contents: write # 允许写入gh-pages分支
11+
contents: write
1212

1313
steps:
1414
# 1. 检出代码
1515
- name: Checkout repository
1616
uses: actions/checkout@v4
1717

18-
# 2. 使用你提供的tldraw设置步骤
19-
- name: Setup tldraw environment
20-
uses: actions/setup-node@v3 # 保持与你提供的配置一致
18+
# 2. 设置 Node.js 环境
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4 # 升级到 v4
2121
with:
22-
node-version: 20.11.0
22+
node-version: 20
2323
cache: 'yarn'
2424

25-
# 3. 启用corepack和安装依赖
26-
- name: Setup environment
25+
# 3. 启用 Corepack 并安装正确 Yarn 版本
26+
- name: Setup Yarn via Corepack
2727
run: |
28-
npm i -g corepack
29-
yarn install --immutable
28+
# 启用 Corepack 并安装 package.json 指定的 Yarn 版本
29+
corepack enable
30+
corepack prepare yarn@stable --activate
31+
32+
# 验证 Yarn 版本
33+
yarn --version
3034
shell: bash
3135

32-
# 4. 构建项目
36+
# 4. 安装依赖
37+
- name: Install dependencies
38+
run: yarn install --immutable
39+
shell: bash
40+
41+
# 5. 构建项目
3342
- name: Build project
3443
run: yarn build
3544
shell: bash
3645

37-
# 5. 部署到GitHub Pages
46+
# 6. 部署到 GitHub Pages
3847
- name: Deploy to gh-pages
3948
uses: peaceiris/actions-gh-pages@v4
4049
with:
4150
github_token: ${{ secrets.GITHUB_TOKEN }}
42-
publish_dir: dist # tldraw默认构建目录
51+
publish_dir: dist

0 commit comments

Comments
 (0)