Skip to content

TEST

TEST #11

Workflow file for this run

name: 배포
on:
push:
branches: [main, deploy/33-BE_cd]
workflow_dispatch:
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: execute remote ssh
uses: appleboy/ssh-action@master
env:
REMOTE_SSH_PASSWORD: ${{ secrets.REMOTE_SSH_PASSWORD }}
with:
host: ${{ secrets.REMOTE_SSH_HOST }}
username: ${{ secrets.REMOTE_SSH_USERNAME }}
password: ${{ secrets.REMOTE_SSH_PASSWORD }}
port: ${{ secrets.REMOTE_SSH_PORT }}
envs: BRANCH_NAME, REMOTE_SSH_PASSWORD
script_stop: true
script: |
cd workspaces/1day1baek/back
git reset --hard HEAD
git checkout -B $BRANCH_NAME
git pull origin $BRANCH_NAME
server_process=$(ps -ef | grep OneDayOneBaek-0.0.1-SNAPSHOT.jar | grep java)
server_pid=(${server_process// / })
server_pid=${server_pid[1]}
echo $REMOTE_SSH_PASSWORD | sudo -S kill -9 $server_pid
./run_sandbox.sh