-
Notifications
You must be signed in to change notification settings - Fork 1
37 lines (35 loc) · 1.26 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Deploy To EC2
on:
push
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: SSH로 EC2에 접속하기
uses: appleboy/[email protected]
env:
APPLICATION_PROPERTIES: ${{ secrets.APPLICATION_PROPERTIES }}
NAVER_CLIENT_ID: ${{ secrets.NAVER_CLIENT_ID }}
NAVER_REDIRECT_URI: ${{ secrets.NAVER_REDIRECT_URI }}
NAVER_CLIENT_SECRET: ${{ secrets.NAVER_CLIENT_SECRET }}
JWT_SECRET_KEY: ${{ secrets.JWT_SECRET_KEY }}
OPENWEATHER_API_KEY: ${{ secrets.OPENWEATHER_API_KEY }}
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USERNAME }}
key: ${{ secrets.EC2_PRIVATE_KEY }}
envs: |
APPLICATION_PROPERTIES
NAVER_CLIENT_ID
NAVER_REDIRECT_URI
NAVER_CLIENT_SECRET
JWT_SECRET_KEY
OPENWEATHER_API_KEY
script_stop: true
script: |
cd /home/ubuntu/WEB1_2_PitchingMate_BE
git pull origin develop
echo "$APPLICATION_PROPERTIES" > src/main/resources/application-dev.yml
./gradlew clean build
sudo fuser -k -n tcp 8080 || true
nohup java -jar build/libs/*SNAPSHOT.jar > ./output.log 2>&1 &