Skip to content

Commit be993f6

Browse files
author
Hermes Cron
committed
fix: npm ci + vite bin 验证 + npm rebuild 自愈
- npm ci 优先,失败则 npm install - 验证 node_modules/.bin/vite 存在 - 若缺失则 npm rebuild vite 再验证 - Build 改回 npm run build
1 parent 45a0953 commit be993f6

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,16 @@ jobs:
2121
node-version: 20
2222

2323
- name: Install dependencies
24-
run: npm install
24+
run: |
25+
npm ci || npm install
26+
ls -la node_modules/.bin/vite || echo "vite bin MISSING - reinstalling"
27+
if [ ! -f node_modules/.bin/vite ]; then
28+
npm rebuild vite || true
29+
ls -la node_modules/.bin/vite
30+
fi
2531
2632
- name: Build
27-
run: npx --yes vite build
33+
run: npm run build
2834
env:
2935
VITE_GITHUB_CLIENT_ID: ${{ secrets.VITE_GITHUB_CLIENT_ID }}
3036

.github/workflows/release.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,16 @@ jobs:
2020
node-version: '20'
2121

2222
- name: Install dependencies
23-
run: npm install
23+
run: |
24+
npm ci || npm install
25+
ls -la node_modules/.bin/vite || echo "vite bin MISSING - reinstalling"
26+
if [ ! -f node_modules/.bin/vite ]; then
27+
npm rebuild vite || true
28+
ls -la node_modules/.bin/vite
29+
fi
2430
2531
- name: Build
26-
run: npx --yes vite build
32+
run: npm run build
2733

2834
- name: Create ZIP archive
2935
run: |

0 commit comments

Comments
 (0)