ci: add Docker cleanup step to prevent disk space exhaustion
Docker Build / Build and Push Docker Image (push) Successful in 4m41s

This commit is contained in:
2026-06-12 00:12:00 +08:00
parent d83db15801
commit 6db071543c
3 changed files with 34 additions and 4 deletions
+10
View File
@@ -70,3 +70,13 @@ jobs:
docker push git.viaeon.com/admin/new-api:${{ env.TAG }}
echo "Pushing latest..."
docker push git.viaeon.com/admin/new-api:latest
- name: Cleanup Docker
if: always()
run: |
echo "Removing local images..."
docker rmi git.viaeon.com/admin/new-api:${{ env.TAG }} git.viaeon.com/admin/new-api:latest 2>/dev/null || true
echo "Pruning unused Docker resources..."
docker system prune -af --volumes 2>/dev/null || true
echo "Docker disk usage:"
docker system df
+12 -2
View File
@@ -58,6 +58,16 @@ jobs:
- name: Push Docker image
run: |
echo "Pushing ${{ env.VERSION }}..."
docker push git.viaeon.com/admin/new-api:${{ env.VERSION }} 2>&1
docker push git.viaeon.com/admin/new-api:${{ env.VERSION }}
echo "Pushing alpha..."
docker push git.viaeon.com/admin/new-api:alpha 2>&1
docker push git.viaeon.com/admin/new-api:alpha
- name: Cleanup Docker
if: always()
run: |
echo "Removing local images..."
docker rmi git.viaeon.com/admin/new-api:${{ env.VERSION }} git.viaeon.com/admin/new-api:alpha 2>/dev/null || true
echo "Pruning unused Docker resources..."
docker system prune -af --volumes 2>/dev/null || true
echo "Docker disk usage:"
docker system df
+12 -2
View File
@@ -58,6 +58,16 @@ jobs:
- name: Push Docker image
run: |
echo "Pushing ${{ env.VERSION }}..."
docker push git.viaeon.com/admin/new-api:${{ env.VERSION }} 2>&1
docker push git.viaeon.com/admin/new-api:${{ env.VERSION }}
echo "Pushing nightly..."
docker push git.viaeon.com/admin/new-api:nightly 2>&1
docker push git.viaeon.com/admin/new-api:nightly
- name: Cleanup Docker
if: always()
run: |
echo "Removing local images..."
docker rmi git.viaeon.com/admin/new-api:${{ env.VERSION }} git.viaeon.com/admin/new-api:nightly 2>/dev/null || true
echo "Pruning unused Docker resources..."
docker system prune -af --volumes 2>/dev/null || true
echo "Docker disk usage:"
docker system df