-
Notifications
You must be signed in to change notification settings - Fork 1
34 lines (29 loc) · 968 Bytes
/
ec2_deploy.yml
File metadata and controls
34 lines (29 loc) · 968 Bytes
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
name: Deploy to EC2
on:
push:
branches: [ "release" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
name: Deploy main branch
runs-on: ubuntu-latest
steps:
- name: Connect ssh and git pull
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.EC2_HOST }}
username: ec2-user
key: ${{ secrets.EC2_PEM_KEY }}
script: |
echo "연결 완료"
cd army/ARdiray_Spring/ardiary/
git checkout release
git pull origin release
kill `ps -ef | grep ardiary-0.0.1-SNAPSHOT.jar | grep -v grep | awk '{print $2}'`
echo "기존 서비스 배포 중지"
sudo ./gradlew build
cd build/libs/
nohup java -jar ardiary-0.0.1-SNAPSHOT.jar 2>&1 &
echo "업데이트 서비스 배포 시작"
exit