Files
MoShiro/.woodpecker/web-build.yml
T
justme d1ece67a6a
ci/woodpecker/push/web-build Pipeline was successful
ci/woodpecker/push/verify Pipeline was canceled
ci/woodpecker/push/dev-image Pipeline was canceled
Build the frontend once per pipeline and reuse it in the dev backend image [CI]
2026-10-21 15:17:37 +08:00

33 lines
1.0 KiB
YAML

labels:
ci: domain-linux-native
platform: linux/amd64
clone:
- name: git
image: plugin-git
settings:
lfs: false
# [CI] 构建要算开发版本号(ci/version.sh:自最近 tag 的提交数),要拿到 tag
tags: true
when:
- event: pull_request
- event: push
branch: main
# 和 verify 并行:前端构建不依赖后端测试,两个同时跑
steps:
- name: web-build
image: bash
environment:
NPM_CONFIG_CACHE: /home/justme/.npm
commands:
# node_modules 按锁文件哈希缓存,展示端和管理端并行构建,再检查 CSS,见 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