File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change 66
77permissions :
88 contents : write
9+ pull-requests : write # 用于 Changesets 评论 PR
910 id-token : write
1011 pages : write # 必须:部署 Pages 需要
11- statuses : write
12+ deployments : write
1213
1314jobs :
1415 # 任务 1:发布到 npm
1516 release :
17+ name : Release & Publish
1618 runs-on : ubuntu-latest
1719 steps :
1820 - uses : actions/checkout@v4
21+ with :
22+ fetch-depth : 0 # 必须获取完整历史,Changesets 才能计算变更
23+ - uses : pnpm/action-setup@v3
1924 - uses : actions/setup-node@v4
2025 with :
2126 node-version : 20
27+ cache : " pnpm"
2228 registry-url : " https://registry.npmjs.org"
23- - run : pnpm install
29+ - run : pnpm install --frozen-lockfile
2430 - name : Create Release PR or Publish
2531 id : changesets
2632 uses : changesets/action@v1
@@ -31,14 +37,21 @@ jobs:
3137
3238 # 任务 2:部署文档到 GitHub Pages
3339 deploy-docs :
40+ name : Deploy Documentation
41+ needs : release # 等待发布任务完成,确保文档是最新的
3442 runs-on : ubuntu-latest
43+ environment :
44+ name : github-pages
45+ url : ${{ steps.deployment.outputs.page_url }}
3546 steps :
3647 - uses : actions/checkout@v4
48+ - uses : pnpm/action-setup@v3
3749 - uses : actions/setup-node@v4
3850 with :
3951 node-version : 20
52+ cache : " pnpm"
4053
41- - run : pnpm install
54+ - run : pnpm install --frozen-lockfile
4255 - name : Build Docs
4356 run : pnpm run demo:build
4457
You can’t perform that action at this time.
0 commit comments