Skip to content

Merge pull request #38 from doghae/Feat/issue#14 #64

Merge pull request #38 from doghae/Feat/issue#14

Merge pull request #38 from doghae/Feat/issue#14 #64

Workflow file for this run

name: Deploy To Ec2
on:
push:
branches:
- main
jobs:
Deploy:
runs-on: ubuntu-latest
steps:
- name: SSH로 EC2에 접속하기
uses: appleboy/[email protected]
env:
APPLICATION_PROD_PROPERTIES: ${{ secrets.APPLICATION_PROPERTIES }}
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USERNAME }}
key: ${{ secrets.EC2_PRIVATE_KEY }}
script-stop: true
script: |
cd /home/ubuntu/backend
rm -rf src/main/resources/application-prod.yml
git pull origin main
echo "${{ secrets.APPLICATION_PROD_PROPERTIES }}" > src/main/resources/application-prod.yml
cat src/main/resources/application-prod.yml
./gradlew clean build -x test -Pprofile=prod
sudo fuser -k -n tcp 8080 || true
nohup java -jar build/libs/*SNAPSHOT.jar > ./output.log 2>&1 &