chore: 新版构建部署流程

This commit is contained in:
lzh
2025-12-23 14:13:20 +08:00
parent e508bd692d
commit e52ffe7375
2 changed files with 12 additions and 8 deletions

View File

@@ -45,12 +45,13 @@ echo "📊 Build size: $BUILD_SIZE"
read -p "Do you want to commit and push to repository? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
# 检查是否有未提交的更改
if [ -n "$(git status --porcelain)" ]; then
# 检查 dist 目录的变化,不检查其他文件
DIST_STATUS=$(git status --porcelain apps/web-antd/dist)
if [ -n "$DIST_STATUS" ]; then
echo "📝 Staging build artifacts..."
# 只添加 dist 目录,不添加其他文件
# 使用 -f 强制添加被 .gitignore 忽略的 dist 目录
git add -f apps/web-antd/dist
git add -A # 添加其他更改
echo "💾 Committing changes..."
# 使用 --no-verify 跳过 pre-commit hooks避免检查大量构建产物文件
@@ -63,7 +64,8 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "✅ Build artifacts pushed successfully!"
echo "⏳ Waiting for CI/CD to deploy..."
else
echo " No changes to commit"
echo " No changes in dist directory to commit"
echo "Note: Only dist directory changes will be committed, other files are ignored"
fi
else
echo " Skipping git push. You can manually commit and push later."