This commit is contained in:
xiongxiao
2026-01-13 16:12:35 +08:00
parent e5a1d0d9e8
commit a77e178431

View File

@@ -71,7 +71,16 @@
image: docker.cnb.cool/kevisual/dev-env:latest
stages:
- name: 检查环境是否需要打包
script:
script:
- |
if [ -f "package.json" ]; then
echo "📦 开始前端构建流程"
npm install -g pnpm || exit 1
pnpm install
pnpm run build || echo "⚠️ 构建失败或无 build script"
else
echo "🔍 非前端项目,跳过打包"
fi
- name: Docker build
script: docker build -t ${CNB_DOCKER_REGISTRY}/${CNB_REPO_SLUG_LOWERCASE}:latest .
- name: Docker push