Dave Kowalski cc717790f7 untag built image after push to bound the dind image store
image-build loads each build into the runner pod's dind (load: true); the
tags then accumulated forever (dozens of stale 2-3GB tags per pod, a chunk
of the runner disk growth). Untag after a successful push and sweep the
now-dangling previous :latest. The buildkit build cache is separate and
refcounts its own layers, so the next build stays warm; when the repo is
'runner' itself the pod's next job re-pulls the ~380MB job image from the
local registry (cheap). Guarded (continue-on-error + || true) so cleanup
never fails a release.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 00:33:56 +00:00
2026-05-06 08:07:18 -05:00

action/image-push

Composite Gitea Action that pushes a locally-built image to code.fritzlab.net and prunes old numeric tags via the Gitea package API.

Pair with action/image-build — image-build loads the image to the runner's local Docker daemon, image-push uploads it.

Usage

- uses: actions/checkout@v4
- uses: https://code.fritzlab.net/action/image-build@v1
  with:
    image: code.fritzlab.net/fritzlab/chrony
- uses: https://code.fritzlab.net/action/image-push@v1
  with:
    image: code.fritzlab.net/fritzlab/chrony
    token: ${{ secrets.CI_BOT_TOKEN }}
    org: fritzlab
    name: chrony

Inputs

Name Required Default Description
image yes Full image name without tag.
tag no github.run_number Tag to push (must already exist locally).
token yes CI_BOT_TOKEN — registry login + cleanup API.
org yes Gitea org for package API (fritzlab, dns).
name yes Package name as registered in the registry.
latest no true Also push a :latest tag.
keep no 3 Numeric tags to retain. Older are deleted.

Behavior

  1. docker login code.fritzlab.net as ci-bot.
  2. docker push <image>:<tag>.
  3. If latest=true, also docker push <image>:latest.
  4. Prune: list numeric tags from Gitea package API, keep the newest keep, delete the rest. Failures here do not fail the workflow (continue-on-error: true).
S
Description
fritzlab composite action: image-push
Readme 30 KiB