From 42a7bf1f75ecd5b0756fdc9ea606628f50f83b4a Mon Sep 17 00:00:00 2001 From: jeongWoon <83337542+jwpark1211@users.noreply.github.com> Date: Wed, 15 May 2024 16:36:47 +0900 Subject: [PATCH] Create backend-cd.yml --- .github/workflows/backend-cd.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/backend-cd.yml diff --git a/.github/workflows/backend-cd.yml b/.github/workflows/backend-cd.yml new file mode 100644 index 0000000..d9a2f3d --- /dev/null +++ b/.github/workflows/backend-cd.yml @@ -0,0 +1,21 @@ +name: Backend CD +on: + push: + branches: + - "master" + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: WAS 인스턴스 접속 및 애플리케이션 실행 + uses: appleboy/ssh-action@v0.1.6 + with: + host: ${{ secrets.AWS_IP }} + username: ubuntu + key: ${{ secrets.SSH_PRIVATE_KEY }} + script: | + sudo docker stop $(docker ps -a -q) + sudo docker rm $(docker ps -a -q) + sudo docker pull jeongwoon1849/bookitty + sudo docker run -d -p 8080:8080 --name new jeongwoon1849/bookitty