From 91b57f32ccca40fe667177bb344fcb728a59b157 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=EC=86=8C=EB=AF=BC?= Date: Tue, 23 Apr 2024 16:40:53 +0900 Subject: [PATCH] =?UTF-8?q?docs:=20docker=20workflow=20sudo=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cicd.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 73319ee..7f040df 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -56,10 +56,10 @@ jobs: - name: Docker build run: | - docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} - docker build -t app . - docker tag app ${{ secrets.DOCKER_USERNAME }}/conet:latest - docker push ${{ secrets.DOCKER_USERNAME }}/conet:latest + sudo docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} + sudo docker build -t app . + sudo docker tag app ${{ secrets.DOCKER_USERNAME }}/conet:latest + sudo docker push ${{ secrets.DOCKER_USERNAME }}/conet:latest - name: Deploy uses: appleboy/ssh-action@master @@ -70,8 +70,8 @@ jobs: key: ${{ secrets.PRIVATE_KEY }} # pem 키 # 도커 작업 script: | - docker pull ${{ secrets.DOCKER_USERNAME }}/conet:latest - docker stop $(docker ps -a -q) - docker run -d --log-driver=syslog -p 9001:9000 ${{ secrets.DOCKER_USERNAME }}/conet:latest - docker rm $(docker ps --filter 'status=exited' -a -q) - docker image prune -a -f \ No newline at end of file + sudo docker pull ${{ secrets.DOCKER_USERNAME }}/conet:latest + sudo docker stop $(docker ps -a -q) + sudo docker run -d --log-driver=syslog -p 9001:9000 ${{ secrets.DOCKER_USERNAME }}/conet:latest + sudo docker rm $(docker ps --filter 'status=exited' -a -q) + sudo docker image prune -a -f \ No newline at end of file