CI: clean up Docker/Podman build artifacts after APK build
build-apk.sh always builds with --no-cache, which piles up images, build cache and containers on the runner over time. Add a cleanup step (if: always(), runs even on failure) that prunes everything via 'docker system prune -af --volumes' or the Podman equivalent, so self-hosted runners don't fill up their disk.
This commit is contained in:
@@ -38,3 +38,15 @@ jobs:
|
||||
with:
|
||||
name: tiptoi-sync-apk
|
||||
path: apk-output/tiptoi-sync.apk
|
||||
|
||||
# Läuft immer, auch wenn der Build fehlschlägt, damit --no-cache-Images/
|
||||
# Build-Cache/Container nicht den Runner-Datenträger zumüllen
|
||||
# (insbesondere relevant für selbst-gehostete/Gitea-Runner).
|
||||
- name: Clean up Docker/Podman build artifacts
|
||||
if: always()
|
||||
run: |
|
||||
if command -v podman > /dev/null 2>&1; then
|
||||
podman system prune -af --volumes
|
||||
elif command -v docker > /dev/null 2>&1; then
|
||||
docker system prune -af --volumes
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user