Skip to content

Commit

Permalink
Update deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
SSUHYUNKIM authored Jan 3, 2025
1 parent 80a31d7 commit 2d2a456
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@ jobs:
- name: 코드 체크아웃
uses: actions/checkout@v3

- name: 디스크 공간 확보
run: |
echo "Before cleanup:"
df -h
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/share/boost
sudo rm -rf /usr/lib/jvm
echo "After cleanup:"
df -h
- name: Gradle 캐시 초기화
run: rm -rf ~/.gradle/caches

- name: JDK 17 설정
uses: actions/setup-java@v3
with:
Expand All @@ -23,7 +37,7 @@ jobs:
run: chmod +x gradlew

- name: 프로젝트 빌드
run: ./gradlew build
run: ./gradlew build --no-daemon --refresh-dependencies

- name: EC2 서버에 파일 전송
uses: appleboy/scp-action@master
Expand All @@ -34,13 +48,12 @@ jobs:
source: "build/libs/*.jar"
target: "~/app/"

- name: SSH를 통한 EC2에 배포
uses: appleboy/ssh-action@v0.1.6
- name: SSH를 통한 EC2 배포 및 실행
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USER }}
key: ${{ secrets.EC2_SSH_KEY }}
script: |
cd /home/ec2-user/app
git pull origin main
./deploy.sh
cd ~/app
java -jar app.jar

0 comments on commit 2d2a456

Please sign in to comment.