Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions .github/workflows/backend-ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,44 +61,53 @@ jobs:
runs-on: ubuntu-latest

steps:
# 1. 코드 체크아웃
- name: Checkout code
uses: actions/checkout@v3

# 2. JDK 17 설치
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

# 3. 빌드 아티팩트 다운로드
- name: Download Build Artifacts
uses: actions/download-artifact@v3
with:
name: build-artifact

# 4. JAR 파일 확인
- name: Verify JAR File
working-directory: HalfFifty_BE
run: ls -la /home/runner/work/HalfFifty/HalfFifty

- name: Set Permissions for JAR File
run: chmod 644 /home/runner/work/HalfFifty/HalfFifty/HalfFifty_BE-0.0.1-SNAPSHOT.jar
# 5. SSH 키 파일 생성 및 권한 설정
- name: Set permissions for private key
run: |
echo "${{ secrets.AWS_KEY }}" > HalfFifty.pem
chmod 600 HalfFifty.pem

# 6. JAR 파일 EC2로 업로드
- name: Upload JAR to EC2
uses: appleboy/[email protected]
with:
host: ${{ secrets.AWS_IP }}
username: ${{ secrets.AWS_USER }}
key: ${{ secrets.AWS_KEY }}
key: HalfFifty.pem
source: /home/runner/work/HalfFifty/HalfFifty/HalfFifty_BE-0.0.1-SNAPSHOT.jar
target: ~/HalfFifty_BE-0.0.1-SNAPSHOT.jar

# 7. Docker Compose를 사용하여 EC2에서 배포
- name: Deploy to EC2 using Docker Compose
uses: appleboy/[email protected]
with:
host: ${{ secrets.AWS_IP }}
username: ${{ secrets.AWS_USER }}
key: ${{ secrets.AWS_KEY }}
key: HalfFifty.pem
script: |
cd ~
docker-compose down || true
docker-compose up -d --build


Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ public class HealthCheck {

@GetMapping("/")
public String health() {
return "server on!!!!!";
return "server on!";
}
}
Loading