Skip to content

Commit befa40b

Browse files
committed
fix: CI/CD部署前清理前端构建产物
- 在重新构建前删除web/dist和web/node_modules - 避免git checkout时的文件冲突 - 确保每次部署都是干净的构建
1 parent e2b1f1b commit befa40b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ jobs:
8484
sudo sed -i "s|Environment=\"JWT_SECRET=.*\"|Environment=\"JWT_SECRET=$JWT_SECRET\"|g" /etc/systemd/system/tinyflow.service
8585
sudo sed -i "s|Environment=\"REDIS_PASSWORD=.*\"|Environment=\"REDIS_PASSWORD=$REDIS_PASSWORD\"|g" /etc/systemd/system/tinyflow.service
8686
87+
# 清理前端构建产物和依赖(避免 git checkout 冲突)
88+
rm -rf web/dist web/node_modules
89+
8790
# 重新构建前端
8891
cd web
8992
npm ci --prefer-offline --no-audit

0 commit comments

Comments
 (0)