Skip to content

Commit fac8cac

Browse files
committed
ci: 최신 이미지 3개만 유지하게 cd 과정 수정
1 parent f20cdf8 commit fac8cac

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,6 @@ jobs:
113113
114114
# Docker 컨테이너 실행
115115
docker run -d --name my-app -p 80:8080 ${{ secrets.DOCKER_USERNAME }}/${{ secrets.APP_NAME }}:latest
116+
117+
# 오래된 이미지 정리 (최신 3개 제외)
118+
docker images --format "{{.Repository}}:{{.Tag}}" | grep "${{ secrets.APP_NAME }}" | tail -n +4 | xargs -r docker rmi

0 commit comments

Comments
 (0)