fix: keep only 2 SHA tags (current + 1 previous) to save disk space
This commit is contained in:
parent
758f0699ff
commit
8adc84699e
1 changed files with 4 additions and 3 deletions
|
|
@ -267,7 +267,7 @@ jobs:
|
|||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Cleanup old image tags (after all builds complete)
|
||||
- name: Cleanup old image tags (keep running + 1 previous)
|
||||
continue-on-error: true
|
||||
env:
|
||||
REGISTRY_HOST: ${{ secrets.REGISTRY_HOSTPORT }}
|
||||
|
|
@ -277,6 +277,7 @@ jobs:
|
|||
run: |
|
||||
set -euo pipefail
|
||||
echo "Starting post-build cleanup for services: $SERVICES_CSV"
|
||||
echo "Policy: Keep only 2 SHA tags (running + 1 previous)"
|
||||
|
||||
IFS=',' read -ra SERVICES <<< "$SERVICES_CSV"
|
||||
for service in "${SERVICES[@]}"; do
|
||||
|
|
@ -286,7 +287,7 @@ jobs:
|
|||
--repo "nxtgauge-rust-$service" \
|
||||
--username "$REGISTRY_USERNAME" \
|
||||
--password "$REGISTRY_PASSWORD" \
|
||||
--keep 3 || echo "Warning: Failed to prune $service (continuing)"
|
||||
--keep 2 || echo "Warning: Failed to prune $service (continuing)"
|
||||
done
|
||||
|
||||
echo "Post-build cleanup completed"
|
||||
echo "Post-build cleanup completed - only 2 most recent SHA tags kept"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue