diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3cd406c..0d5299c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -28,26 +28,22 @@ jobs: script: | cd workspaces/1day1baek/back - # git reset --hard HEAD + git reset --hard HEAD - # cur_git_branch=$(git branch --show-current) - # if [ "$cur_git_branch" != "$BRANCH_NAME" ]; then - # git switch deploy/33-BE_cd - # fi - # git pull origin deploy/33-BE_cd + cur_git_branch=$(git branch --show-current) + if [ "$cur_git_branch" != "$BRANCH_NAME" ]; then + git switch deploy/33-BE_cd + fi + git pull origin deploy/33-BE_cd - # server_process=$(ps -ef | grep OneDayOneBaek-0.0.1-SNAPSHOT.jar$ | grep java) - # server_pid=(${server_process// / }) - # server_pid=${server_pid[1]} + server_process=$(ps -ef | grep OneDayOneBaek-0.0.1-SNAPSHOT.jar$ | grep java) + server_pid=(${server_process// / }) + server_pid=${server_pid[1]} - # if [ -n "$server_pid" ]; then - # echo "existed server pid : $server_pid" + if [ -n "$server_pid" ]; then + echo "existed server pid : $server_pid" - # echo $REMOTE_SSH_PASSWORD | sudo -S kill -9 $server_pid - # fi + echo $REMOTE_SSH_PASSWORD | sudo -S kill -9 $server_pid + fi - which asdf - asdf list - - ./gradlew clean build -x test - nohup java -Dspring.profiles.active=sandbox -jar build/libs/OneDayOneBaek-0.0.1-SNAPSHOT.jar > log.txt 2>&1 & \ No newline at end of file + ./run_sandbox.sh \ No newline at end of file