Skip to content

Deploy Backend Application #14

Deploy Backend Application

Deploy Backend Application #14

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 &