Deploy Backend Application #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Backend Application | |
on: | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: SSH로 EC2에 접속하여 배포하기 | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.BE_SERVER_IP }} | |
username: ${{ secrets.SSH_USER }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
script_stop: true | |
script: | | |
rm -rf /home/ubuntu/deploy/current | |
mkdir /home/ubuntu/deploy/current | |
cp /home/ubuntu/deploy/tobe/backend/moim-today.jar /home/ubuntu/deploy/current/moim-today.jar | |
cd /home/ubuntu/deploy/current | |
sudo fuser -k -n tcp 8080 || true | |
nohup java -jar moim-today.jar > /dev/null 2>&1 & |