Skip to content

Commit

Permalink
MATE-82 : [FEAT] 깃허브 액션을 사용한 CI/CD 구축 (#71)
Browse files Browse the repository at this point in the history
* MATE-82 : [FEAT] 깃허브 액션을 사용한 CI/CD 구축

* MATE-82 : [FEAT] yml 파일 이름 수정

* MATE-82 : [FEAT] deploy.yml 수정
  • Loading branch information
juchan204 authored Dec 3, 2024
1 parent 45a8d2f commit 8f2db93
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deploy To EC2

on:
push:
branches:
- develop

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: SSH로 EC2에 접속하기
uses: appleboy/[email protected]
env:
APPLICATION_PROPERTIES: ${{ secrets.APPLICATION_PROPERTIES }}
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USERNAME }}
key: ${{ secrets.EC2_PRIVATE_KEY }}
envs: APPLICATION_PROPERTIES
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 &
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ out/
!**/src/main/**/out/
!**/src/test/**/out/
application-local.yml
application-dev.yml

### NetBeans ###
/nbproject/private/
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
spring:
profiles:
group:
develop:
production:
develop: dev, common
production: prod, common
local: local, common
active: local
active: ${SPRING_PROFILES_ACTIVE:develop}

0 comments on commit 8f2db93

Please sign in to comment.