Build the frontend once per pipeline and reuse it in the dev backend image [CI]
This commit is contained in:
1 parent
3654d37da5
commit
d1ece67a6a
5 files changed
+82
-6
No files matched your search
@@ -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
|
||||
Reference in new issue
Block a user