From 9cbbaf0f02384801c8274e8f437e9e45c4f032bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EA=B0=80=EC=98=81?= Date: Mon, 24 Jun 2024 20:57:54 +0900 Subject: [PATCH] fix: ci --- .github/workflows/main.yml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 373c5b4..48f213d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,19 +40,15 @@ jobs: uses: appleboy/ssh-action@master id: deploy-prod with: - host: ${{ secrets.HOST_PROD }} # EC2 퍼블릭 IPv4 DNS + host: ${{ secrets.HOST_PROD }} username: ubuntu - key: ${{ secrets.PRIVATE_KEY }} # EC2 private key - port: ${{ secrets.PORT }} #ssh port (22) + key: ${{ secrets.PRIVATE_KEY }} + port: ${{ secrets.PORT }} envs: GITHUB_SHA script: | docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} - docker stop clock - docker rm clock - docker rmi ${{ secrets.DOCKER_USERNAME }}/clock:latest + docker stop clock || true + docker rm clock || true + docker rmi ${{ secrets.DOCKER_USERNAME }}/clock:latest docker pull ${{ secrets.DOCKER_USERNAME }}/clock:latest - docker run -d -p 80:8080 --name clock \ - -e DB_URL=${{ secrets.DB_URL }} \ - -e DB_USERNAME=${{ secrets.DB_USERNAME }} \ - -e DB_PASSWORD=${{ secrets.DB_PASSWORD }} \ - ${{ secrets.DOCKER_USERNAME }}/clock:latest + docker run -d -p 80:8080 --name alimo ${{ secrets.DOCKER_USERNAME }}/alimo:latest