From e5bb6d3a1bfde677a92b9bfe869d2e312fbfc403 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=98=9C=EC=88=98?= Date: Thu, 25 Jan 2024 17:17:55 +0900 Subject: [PATCH] =?UTF-8?q?ci=20:=20github=20action=20=EC=BD=94=EB=93=9C?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev-deploy.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dev-deploy.yml b/.github/workflows/dev-deploy.yml index 97599c73..90dfc0b4 100644 --- a/.github/workflows/dev-deploy.yml +++ b/.github/workflows/dev-deploy.yml @@ -63,4 +63,25 @@ jobs: context: . push: true tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + labels: ${{ steps.meta.outputs.labels }} + + code-deploy: + needs: build-and-push-image + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Access to server and Run container + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.SERVER_IP }} + username: ${{ secrets.SERVER_USER }} + password: ${{ secrets.SSH_PASSWORD }} + script: | + cd reviewzip-server + docker-compose down + docker-compose rm + docker rmi ${{ secrets.IMAGE_NAME }} + docker pull ${{ secrets.IMAGE_NAME }} + docker-compose up -d \ No newline at end of file