Skip to content

Commit a23a1f4

Browse files
ci: switch docs deploy to pnpm + mirror imx-forge's deploy workflow
- drop npm (package-lock.json); adopt pnpm + pnpm-lock.yaml + pnpm-workspace.yaml (consistent with imx-forge, the sibling studio project) - deploy.yml mirrors imx-forge exactly: pnpm/action-setup@v4 (v10), Node 22, pnpm install --frozen-lockfile, peaceiris/actions-gh-pages@v4 pushing site/.vitepress/dist to the gh-pages branch (was actions/deploy-pages) - pnpm-workspace.yaml: allowBuilds esbuild: true (match imx; esbuild postinstall needs to run for VitePress/Vite) Verified: pnpm install --frozen-lockfile + pnpm build both green locally.
1 parent 00bd66a commit a23a1f4

4 files changed

Lines changed: 1666 additions & 2400 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 21 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,42 @@
1-
name: Deploy Docs
1+
name: Deploy VitePress
22

33
on:
44
push:
5-
branches: [main]
6-
paths:
7-
- 'document/**'
8-
- 'site/**'
9-
- 'project.config.ts'
10-
- 'package.json'
11-
- 'package-lock.json'
12-
- '.github/workflows/deploy.yml'
5+
branches:
6+
- main
137
workflow_dispatch:
148

159
permissions:
16-
contents: read
17-
pages: write
18-
id-token: write
19-
20-
concurrency:
21-
group: pages
22-
cancel-in-progress: false
10+
contents: write
2311

2412
jobs:
25-
build:
13+
deploy:
2614
runs-on: ubuntu-latest
15+
2716
steps:
28-
- uses: actions/checkout@v4
17+
- name: Checkout
18+
uses: actions/checkout@v4
2919
with:
30-
# VitePress lastUpdated 依赖完整 git 历史
3120
fetch-depth: 0
3221

33-
- name: Setup Node
22+
- name: Setup Node.js
3423
uses: actions/setup-node@v4
3524
with:
36-
node-version: 20
37-
cache: npm
25+
node-version: '22'
3826

39-
- name: Setup Pages
40-
uses: actions/configure-pages@v5
27+
- name: Setup pnpm
28+
uses: pnpm/action-setup@v4
29+
with:
30+
version: 10
4131

4232
- name: Install dependencies
43-
run: npm ci
44-
45-
- name: Build VitePress site
46-
run: npm run build
33+
run: pnpm install --frozen-lockfile
4734

48-
- name: Upload artifact
49-
uses: actions/upload-pages-artifact@v3
50-
with:
51-
path: site/.vitepress/dist
35+
- name: Build
36+
run: pnpm build
5237

53-
deploy:
54-
needs: build
55-
runs-on: ubuntu-latest
56-
environment:
57-
name: github-pages
58-
url: ${{ steps.deployment.outputs.page_url }}
59-
steps:
6038
- name: Deploy to GitHub Pages
61-
id: deployment
62-
uses: actions/deploy-pages@v4
39+
uses: peaceiris/actions-gh-pages@v4
40+
with:
41+
github_token: ${{ secrets.GITHUB_TOKEN }}
42+
publish_dir: ./site/.vitepress/dist

0 commit comments

Comments
 (0)