DOCS : Modify Application.yml #34
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |