From 91330af4de0f3075a2c015e0366bdbad214a4ef1 Mon Sep 17 00:00:00 2001 From: HEE-GEON Date: Sat, 9 Dec 2023 15:28:15 +0900 Subject: [PATCH] Update gradle.yml --- .github/workflows/gradle.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index df4ed2d..577da01 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -63,9 +63,8 @@ jobs: - name: Docekr Build run: | docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} - docker build -t app . - docker tag app ${{ secrets.DOCKER_USERNAME }}/hbc:latest - docker push ${{ secrets.DOCKER_USERNAME }}/hbc:latest + docker build -t ${{ secrets.DOCKER_USERNAME }}/hbc . + docker push ${{ secrets.DOCKER_USERNAME }}/hbc # 도커 컨테이너 변경 - name: Deploy @@ -75,12 +74,10 @@ jobs: username: ec2-user key: ${{ secrets.PRIVATE_KEY }} # pem 키 script: | - docker stop $(docker ps -a -q) - docker rm $(docker ps -a -q) - docker rmi ${{ secrets.USERNAME }}/hbc - docker pull ${{ secrets.USERNAME }}/hbc:latest + sudo docker rm $(docker ps -a -q) + sudo docker pull ${{ secrets.USERNAME }}/hbc docker-compose up -d - docker image prune -a -f + sudo docker image prune -f