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"