From 6064ef07599de1dc9d59094afd2f993103309f8e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 12 Mar 2026 06:48:18 +0000 Subject: [PATCH] chore: sync workflows from base-template --- .github/workflows/script/re-pull.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/script/re-pull.sh b/.github/workflows/script/re-pull.sh index 658ec835..0aa3fa60 100644 --- a/.github/workflows/script/re-pull.sh +++ b/.github/workflows/script/re-pull.sh @@ -97,11 +97,21 @@ while [ $COUNT -lt $MAX_RETRY ]; do exit 1 fi - if [ "$NEW_RUNNING" -gt "0" ]; then + if [ "$NEW_RUNNING" -gt "0" ]; then + # Cleanup dangling images setelah redeploy sukses + echo "๐Ÿงน Membersihkan dangling images..." + curl -s -X POST "https://${PORTAINER_URL}/api/endpoints/${ENDPOINT_ID}/docker/images/prune" \ + -H "Authorization: Bearer ${TOKEN}" \ + -H "Content-Type: application/json" \ + -d '{"filters":{"dangling":["true"]}}' | jq -r '" Reclaimed: \(.SpaceReclaimed // 0 | . / 1073741824 | tostring | .[0:5]) GB"' + + echo "โœ… Cleanup selesai!" echo "" echo "โœ… Stack $STACK_NAME berhasil di-redeploy dengan image baru dan running!" exit 0 fi + + done echo ""