- dev images are built only when the push touched code that image uses (path filters); webdrop-files does not wait for the frontend build - one v* tag releases both images (:tag and :latest) after the shared checks - registry build and push live in scripts/ci-publish-image.sh, used by every workflow - containers: fix the api Containerfile (missing Sync project), add Containerfile.files, Quadlet units for the file service (prod and dev), env examples, and registry auto-update for the production units so each machine pulls only the image it runs
47 lines
1.3 KiB
YAML
47 lines
1.3 KiB
YAML
# 文件服务(fileAPI)的开发镜像:提交信息带 [CI],并且这次推送改到了文件服务用到的代码时才构建。
|
|
# 推送 webdrop-files:dev(放文件的机器上的 podman auto-update 跟踪它)和 webdrop-files:dev-<提交>
|
|
when:
|
|
- event: push
|
|
branch: [master, main]
|
|
evaluate: 'CI_COMMIT_MESSAGE contains "[CI]"'
|
|
path:
|
|
include:
|
|
- 'server/Containerfile.files'
|
|
- 'server/Directory.Build.props'
|
|
- 'server/src/WebDrop.FileApi/**'
|
|
- 'server/src/WebDrop.FileProtocol/**'
|
|
- 'server/src/WebDrop.Sync/**'
|
|
- 'scripts/ci-publish-image.sh'
|
|
- '.woodpecker/dev-image-files.yml'
|
|
- event: manual
|
|
|
|
labels:
|
|
ci: domain-linux-native
|
|
platform: linux/amd64
|
|
|
|
clone:
|
|
- name: git
|
|
image: woodpeckerci/plugin-git:2.9.3
|
|
settings:
|
|
remote:
|
|
from_secret: gitea_clone_webdrop
|
|
lfs: false
|
|
|
|
# 文件服务不带前端,不用等前端构建
|
|
depends_on:
|
|
- ci
|
|
|
|
concurrency: 1
|
|
|
|
steps:
|
|
publish-dev-image:
|
|
image: bash
|
|
environment:
|
|
ZOT_USERNAME: justme
|
|
ZOT_SECRET:
|
|
from_secret: zot_secret
|
|
ZOT_REGISTRY: registry.oeo.one
|
|
commands:
|
|
- sha="${CI_COMMIT_SHA:0:7}"
|
|
- bash scripts/ci-publish-image.sh webdrop-files server/Containerfile.files "dev-$sha" dev
|