Skip to content

DOCS : Modify Application.yml #34

DOCS : Modify Application.yml

DOCS : Modify Application.yml #34

Workflow file for this run

name: ssh for release deploy
on:
push:
branches: [ develop ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: SSH Remote Commands
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
timeout: 40s
script: |
echo "1. project root둜 이동"
cd ~/livable/server
echo "2. git pull"
git pull origin develop
echo "3. project build"
./gradlew clean build
if [ $? -eq 0 ]; then
# λΉŒλ“œ 성곡 μ‹œ
echo "4. 싀행쀑인 ν”„λ‘œμ„ΈμŠ€ 확인"
CURRENT_PID=$(pgrep -f ${{ secrets.PROJECT_ROOT }}/build/libs/server-0.0.1-SNAPSHOT.jar)
echo "5. 싀행쀑인 ν”„λ‘œμ„ΈμŠ€ 쀑지"
sudo kill -9 $CURRENT_PID
echo "6. ν™ˆ 경둜 이동 ν›„ ν”„λ‘œμ νŠΈ μž¬μ‹€ν–‰"
cd ~
nohup java -jar ${{ secrets.PROJECT_ROOT }}/build/libs/server-0.0.1-SNAPSHOT.jar --spring.profiles.active=prod > nohup.out 2> nohup.err < /dev/null &
else
echo "ν”„λ‘œμ νŠΈ Build μ‹€νŒ¨"
exit 1
fi