From c7e8109bbd184fa90d5211f68600098a6248d5fc Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Thu, 28 May 2026 00:33:26 +0200 Subject: [PATCH] =?UTF-8?q?Add=20manual=20Forgejo=20action=20to=20promote?= =?UTF-8?q?=20:latest=20=E2=86=92=20:prod?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .forgejo/workflows/promote_to_prod.yaml | 41 +++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .forgejo/workflows/promote_to_prod.yaml diff --git a/.forgejo/workflows/promote_to_prod.yaml b/.forgejo/workflows/promote_to_prod.yaml new file mode 100644 index 0000000..f17358c --- /dev/null +++ b/.forgejo/workflows/promote_to_prod.yaml @@ -0,0 +1,41 @@ +# ============================================================================= +# Forgejo Actions workflow to promote the "latest" image to "prod" +# ============================================================================= +# Triggered manually via the Forgejo UI ("Run workflow" button). +# Pulls the current :latest image and re-tags it as :prod. +# ----------------------------------------------------------------------------- + +name: Promote :latest → :prod + +on: + workflow_dispatch: + +jobs: + promote: + runs-on: docker + permissions: + contents: read + packages: write + + steps: + - name: Install Docker CLI + run: | + apt-get update -qq + apt-get install -y --no-install-recommends docker.io + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Registry + uses: docker/login-action@v3 + with: + registry: git.workaround.org + username: ${{ github.actor }} + password: ${{ secrets.FORGEJO_TOKEN }} + + - name: Tag :latest → :prod + run: | + IMG="git.workaround.org/${{ github.repository }}" + docker buildx imagetools create \ + --tag "${IMG}:prod" \ + "${IMG}:latest"