Trigger docker publish on latest master push as well

This commit is contained in:
WeebDataHoarder
2025-04-07 22:31:06 +02:00
parent 903b4e26bd
commit 1144424eff
2 changed files with 46 additions and 10 deletions

View File

@@ -51,7 +51,7 @@ local Build(go, alpine, os, arch) = {
] ]
}; };
local Publish(go, alpine, os, arch, platforms) = { local Publish(go, alpine, os, arch, trigger, platforms, extra) = {
kind: "pipeline", kind: "pipeline",
type: "docker", type: "docker",
name: "publish-" + go + "-alpine" + alpine, name: "publish-" + go + "-alpine" + alpine,
@@ -59,10 +59,7 @@ local Publish(go, alpine, os, arch, platforms) = {
os: os, os: os,
arch: arch, arch: arch,
}, },
trigger: { trigger: trigger,
event: ["promote"],
target: ["production"],
},
steps: [ steps: [
{ {
name: "docker", name: "docker",
@@ -79,7 +76,6 @@ local Publish(go, alpine, os, arch, platforms) = {
from_builder: "golang:" + go +"-alpine" + alpine, from_builder: "golang:" + go +"-alpine" + alpine,
from: "alpine:" + alpine, from: "alpine:" + alpine,
}, },
auto_tag: true,
auto_tag_suffix: "alpine" + alpine, auto_tag_suffix: "alpine" + alpine,
username: { username: {
from_secret: "git_username", from_secret: "git_username",
@@ -87,7 +83,7 @@ local Publish(go, alpine, os, arch, platforms) = {
password: { password: {
from_secret: "git_password", from_secret: "git_password",
}, },
} } + extra,
}, },
] ]
}; };
@@ -100,6 +96,9 @@ local Publish(go, alpine, os, arch, platforms) = {
Build("1.24", "3.21", "linux", "amd64"), Build("1.24", "3.21", "linux", "amd64"),
Build("1.24", "3.21", "linux", "arm64"), Build("1.24", "3.21", "linux", "arm64"),
Publish("1.24", "3.21", "linux", "amd64", ["linux/amd64", "linux/arm64"]), # latest
Publish("1.22", "3.20", "linux", "amd64", ["linux/amd64", "linux/arm64"]), Publish("1.24", "3.21", "linux", "amd64", {event: ["push"], branch: ["master"], }, ["linux/amd64", "linux/arm64"], {tags: ["latest"],}) + {name: "publish-latest"},
Publish("1.24", "3.21", "linux", "amd64", {event: ["promote", "tag"], target: ["production"], }, ["linux/amd64", "linux/arm64"], {auto_tag: true,}),
# legacy
Publish("1.22", "3.20", "linux", "amd64", {event: ["promote", "tag"], target: ["production"], }, ["linux/amd64", "linux/arm64"], {auto_tag: true,}),
] ]

View File

@@ -160,6 +160,41 @@ steps:
type: docker type: docker
--- ---
kind: pipeline kind: pipeline
name: publish-latest
platform:
arch: amd64
os: linux
steps:
- image: plugins/buildx
name: docker
privileged: true
settings:
auto_tag_suffix: alpine3.21
build_args:
from: alpine:3.21
from_builder: golang:1.24-alpine3.21
builder_driver: docker-container
compress: true
password:
from_secret: git_password
platform:
- linux/amd64
- linux/arm64
registry: git.gammaspectra.live
repo: git.gammaspectra.live/git/go-away
squash: true
tags:
- latest
username:
from_secret: git_username
trigger:
branch:
- master
event:
- push
type: docker
---
kind: pipeline
name: publish-1.24-alpine3.21 name: publish-1.24-alpine3.21
platform: platform:
arch: amd64 arch: amd64
@@ -189,6 +224,7 @@ steps:
trigger: trigger:
event: event:
- promote - promote
- tag
target: target:
- production - production
type: docker type: docker
@@ -223,11 +259,12 @@ steps:
trigger: trigger:
event: event:
- promote - promote
- tag
target: target:
- production - production
type: docker type: docker
--- ---
kind: signature kind: signature
hmac: b24b30bb7ac591a385173daeb0edbcd9119918ee9e38be90d232f83b8b767115 hmac: ce284b67eca8ab7014d65a72c617d6ed4d50bdfe4b0103ea47a07ef9d3ee0c68
... ...