From c7bfc3af1c2782a90ce402e9fe2f3c4ee1320f56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=86=90=ED=99=8D=EC=84=9D?= <78216059+bayy1216@users.noreply.github.com> Date: Sun, 2 Jun 2024 17:24:25 +0900 Subject: [PATCH] =?UTF-8?q?[Feat]:=20ci-cd=20=EC=8A=A4=ED=81=AC=EB=A6=BD?= =?UTF-8?q?=ED=8A=B8=20=EA=B0=80=EB=8F=85=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cicd.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 8fec88d..ef4005b 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -49,8 +49,19 @@ jobs: key: ${{ secrets.KEY }} port: 22 script: | - docker rm -f $(docker ps -qa) # 기존에 실행되고 있는 도커 프로세스들을 제거합니다. mysql 컨테이너는 제거하지 않습니다. - docker rmi $(docker images -q) # 기존에 사용되고 있는 도커 이미지들을 제거합니다. mysql 이미지는 제거하지 않습니다. + docker rm -f $(docker ps -qa) # 기존에 실행되고 있는 도커 프로세스들을 제거합니다. + docker rmi $(docker images -q) # 기존에 사용되고 있는 도커 이미지들을 제거합니다. docker image prune -f # 사용하지 않는 도커 이미지들을 제거합니다. docker pull ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }}:${{ github.sha }} - docker run -d -p 80:8080 -e SPRING_PROFILES_ACTIVE=prod -e KAKAO_CLIENT_SECRET=${{ secrets.KAKAO_CLIENT_SECRET }} -e NAVER_CLIENT_SECRET=${{ secrets.NAVER_CLIENT_SECRET }} -e KAKAO_REDIRECT_URI=${{ secrets.KAKAO_REDIRECT_URI }} -e MYSQL_URL=${{ secrets.MYSQL_URL }} -e MYSQL_USERNAME=${{ secrets.MYSQL_USERNAME }} -e MYSQL_PASSWORD=${{ secrets.MYSQL_PASSWORD }} -e S3_BUCKET=${{ secrets.S3_BUCKET }} -e S3_ACCESS_KEY=${{ secrets.S3_ACCESS_KEY }} -e S3_SECRET_KEY=${{ secrets.S3_SECRET_KEY }} ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }}:${{ github.sha }} + + docker run -d -p 80:8080 -e SPRING_PROFILES_ACTIVE=prod \ + -e KAKAO_CLIENT_SECRET=${{ secrets.KAKAO_CLIENT_SECRET }} \ + -e NAVER_CLIENT_SECRET=${{ secrets.NAVER_CLIENT_SECRET }} \ + -e KAKAO_REDIRECT_URI=${{ secrets.KAKAO_REDIRECT_URI }} \ + -e MYSQL_URL=${{ secrets.MYSQL_URL }} \ + -e MYSQL_USERNAME=${{ secrets.MYSQL_USERNAME }} \ + -e MYSQL_PASSWORD=${{ secrets.MYSQL_PASSWORD }} \ + -e S3_BUCKET=${{ secrets.S3_BUCKET }} \ + -e S3_ACCESS_KEY=${{ secrets.S3_ACCESS_KEY }} \ + -e S3_SECRET_KEY=${{ secrets.S3_SECRET_KEY }} \ + ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }}:${{ github.sha }}