From 66a13b78ac5c96d46f09d95caaf59c6398d48c89 Mon Sep 17 00:00:00 2001 From: Yeonsoo Kang <90603399+Kang1221@users.noreply.github.com> Date: Wed, 27 Nov 2024 22:16:53 +0900 Subject: [PATCH] feat: delete old docker images --- .github/workflows/gradle.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 0081546..b053e80 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -62,7 +62,10 @@ jobs: sudo docker pull ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY }}:${GITHUB_SHA::7} sudo docker tag ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY }}:${GITHUB_SHA::7} ddanzi sudo docker-compose up -d --remove-orphans - + + echo "Removing old Docker images..." + sudo docker image prune -af --filter "until=24h" + # Deploy_production deploy_production: runs-on: ubuntu-latest @@ -84,4 +87,7 @@ jobs: sudo docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_PASSWORD }} sudo docker pull ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY }}:${GITHUB_SHA::7} sudo docker tag ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY }}:${GITHUB_SHA::7} ddanzi - sudo docker-compose up -d --remove-orphans \ No newline at end of file + sudo docker-compose up -d --remove-orphans + + echo "Removing old Docker images..." + sudo docker image prune -af --filter "until=24h"