diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f76698f..b7a8d58 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -28,17 +28,15 @@ jobs: script: | cd workspaces/1day1baek/back - echo 11111111111111111111111111111111111111111 - git checkout -B $BRANCH_NAME - git pull origin $BRANCH_NAME - echo 2222222222222222222222222222222222 + git reset --hard HEAD + git switch deploy/33-BE_cd + git pull server_process=$(ps -ef | grep OneDayOneBaek-0.0.1-SNAPSHOT.jar$ | grep java) - echo 333333333333333333333333333333333 + server_pid=(${server_process// / }) + server_pid=${server_pid[1]} - if [ -n "$server_process" ]; then - server_pid=(${server_process// / }) - server_pid=${server_pid[1]} + if [ -n "$server_pid" ]; then echo "existed server pid : $server_pid" echo $REMOTE_SSH_PASSWORD | sudo -S kill -9 $server_pid