Build the frontend once per pipeline and reuse it in the dev backend image [CI]
ci/woodpecker/push/web-build Pipeline was successful
ci/woodpecker/push/verify Pipeline was canceled
ci/woodpecker/push/dev-image Pipeline was canceled

This commit is contained in:
justme committed 2026-10-21 15:17:37 +08:00
1 parent 3654d37da5
commit d1ece67a6a
5 files changed
+82 -6

No files matched your search

+9 -1
View File
@@ -7,6 +7,8 @@ clone:
image: plugin-git
settings:
lfs: false
# [CI] 构建要算开发版本号(ci/version.sh:自最近 tag 的提交数),要拿到 tag
tags: true
when:
- event: pull_request
@@ -21,4 +23,10 @@ steps:
NPM_CONFIG_CACHE: /home/justme/.npm
commands:
# node_modules 按锁文件哈希缓存,展示端和管理端并行构建,再检查 CSS,见 ci/web-build.sh
- python3 ci/guard-step.py web-build 900 bash ci/web-build.sh
# main 上带 [CI] 的提交:先写入开发版本号,构建完把产物交给同一条流水线的开发镜像(ci/shared-web.sh),前端只构建一次
- |
if [ "$CI_PIPELINE_EVENT" = push ] && printf '%s' "$CI_COMMIT_MESSAGE" | grep -qF '[CI]'; then
export WEB_PUBLISH_SHARED=1
bash ci/version.sh apply
fi
python3 ci/guard-step.py web-build 900 bash ci/web-build.sh