Add dangling-only image prune after build (keeps tagged :latest)
Build and Push Docker Image / build (push) Successful in 2m20s

This commit is contained in:
2026-07-02 09:18:04 -05:00
parent a9df9c0cf4
commit 7c6ccc6b8a
+7
View File
@@ -26,3 +26,10 @@ jobs:
IMAGE="registry.alwisp.com/${{ gitea.repository }}" IMAGE="registry.alwisp.com/${{ gitea.repository }}"
docker build -t "${IMAGE}:latest" . docker build -t "${IMAGE}:latest" .
docker push "${IMAGE}:latest" docker push "${IMAGE}:latest"
# Dangling-only prune: removes untagged leftovers from previous builds.
# Never removes the tagged :latest (kept for the Unraid deployment) or
# any image referenced by a container.
- name: Prune dangling images on host
if: always()
run: docker image prune -f 2>/dev/null || true