build(deploy): 优化部署脚本,每次部署先清理缓存再重建优化缓存

This commit is contained in:
2026-03-28 21:54:24 +08:00
parent a69a20ee1e
commit 5d4a0dd00f

View File

@@ -48,9 +48,6 @@ npm run build
if [ $? -ne 0 ]; then echo -e "${RED}❌ npm run build 失败${NC}"; exit 1; fi
echo -e "${GREEN}✅ 前端资源构建完成。${NC}"
# 3. 清理缓存
echo -e "${YELLOW}[4/7] 清理缓存...${NC}"
php artisan config:clear && php artisan cache:clear && php artisan view:clear
# 4. 数据库迁移
echo -e "${YELLOW}[5/7] 数据库迁移...${NC}"
@@ -58,7 +55,7 @@ php artisan migrate --force
# 5. 优化
echo -e "${YELLOW}[6/7] 生产环境优化...${NC}"
php artisan config:cache && php artisan route:cache && php artisan view:cache
php artisan optimize:clear && php artisan optimize && php artisan view:cache
# 6. 权限
echo -e "${YELLOW}[7/7] 修复权限...${NC}"