From b7614db962c90807f03fe30e6033e0825a70a98e Mon Sep 17 00:00:00 2001 From: SangYeong Park <107484383+Imsyp@users.noreply.github.com> Date: Fri, 11 Oct 2024 12:14:31 +0900 Subject: [PATCH] Update server_cicd.yml --- .github/workflows/server_cicd.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/server_cicd.yml b/.github/workflows/server_cicd.yml index 251b07f..7c96893 100644 --- a/.github/workflows/server_cicd.yml +++ b/.github/workflows/server_cicd.yml @@ -32,6 +32,27 @@ jobs: cd server ./gradlew build -x test + - name: Deploy to Internal Server through Bastion Host + if: success() + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.GCP_INTERNAL_SERVER_VM_HOST }} + username: ${{ secrets.GCP_SERVER_VM_USER }} + key: ${{ secrets.GCP_INTERNAL_SERVER_SSH_PRIVATE_KEY }} + port: 22 + proxy_host: ${{ secrets.GCP_SERVER_VM_HOST }} + proxy_username: ${{ secrets.GCP_SERVER_VM_USER }} + proxy_key: ${{ secrets.GCP_SERVER_SSH_PRIVATE_KEY }} + proxy_port: 22 + script: | + sudo docker image prune -f + # sudo docker stop swdc-container || true + # sudo docker rm swdc-container || true + + # cd /home/patturning2/deployment + # sudo docker build -t swdc-app . + # sudo docker run -d -p 8080:8080 --name swdc-container -v /mnt:/mnt swdc-app + - name: Deliver jar File to Internal Server through Bastion Host if: success() uses: appleboy/scp-action@v0.1.7