From 2536f223b7876149f344c9832aa9b466e9311f3b Mon Sep 17 00:00:00 2001 From: Veillax <126523099+Veillax@users.noreply.github.com> Date: Sun, 1 Nov 2026 00:35:41 -0600 Subject: [PATCH] Publish the container image on release The compose file pulled git.veillax.com/veillax/mako:latest, which was never built. The release workflow now builds and pushes it, as Hammerhead's does. Co-Authored-By: Claude Sonnet 5.5 --- .gitea/workflows/release.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 50ee00f..7b04ccc 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -32,3 +32,25 @@ jobs: env: TOKEN: ${{ secrets.RELEASE_TOKEN || secrets.GITHUB_TOKEN }} run: sh deploy/publish-release.sh "${GITHUB_REF_NAME}" + + # Skipped when the repository variable PUBLISH_DOCKER is "false", or fails alone + # if this runner has no Docker: the release above is already published by then. + # Optional secret REGISTRY_TOKEN (and variable REGISTRY_USER): an access token + # with package write permission, for servers where the job token can't push. + - name: Build and push the container image + if: ${{ vars.PUBLISH_DOCKER != 'false' }} + env: + REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN || secrets.GITHUB_TOKEN }} + REGISTRY_USER: ${{ vars.REGISTRY_USER || github.actor }} + run: | + host=${GITHUB_SERVER_URL#*://} + owner=$(echo "$GITHUB_REPOSITORY_OWNER" | tr 'A-Z' 'a-z') + image="$host/$owner/mako" + echo "$REGISTRY_TOKEN" | docker login "$host" -u "$REGISTRY_USER" --password-stdin + docker buildx create --name release --driver docker-container --use >/dev/null 2>&1 || docker buildx use release + tags="-t $image:$GITHUB_REF_NAME" + case "$GITHUB_REF_NAME" in + *-*) ;; # pre-releases (v1.0.0-rc1) don't move :latest + *) tags="$tags -t $image:latest" ;; + esac + docker buildx build --platform linux/amd64 $tags --push .