chore: sync workflows from base-template
This commit is contained in:
10
.github/workflows/script/re-pull.sh
vendored
10
.github/workflows/script/re-pull.sh
vendored
@@ -98,10 +98,20 @@ while [ $COUNT -lt $MAX_RETRY ]; do
|
|||||||
fi
|
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 ""
|
||||||
echo "✅ Stack $STACK_NAME berhasil di-redeploy dengan image baru dan running!"
|
echo "✅ Stack $STACK_NAME berhasil di-redeploy dengan image baru dan running!"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
|
|||||||
Reference in New Issue
Block a user