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
15 changes: 11 additions & 4 deletions .github/workflows/backend-ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,31 +87,38 @@ jobs:
# 5. SSH 키 파일 생성 및 권한 설정
- name: Set permissions for private key
run: |
echo "${{ secrets.AWS_KEY }}" > HalfFifty.pem
chmod 600 HalfFifty.pem
echo "${{ secrets.AWS_KEY }}" > ${{ github.workspace }}/HalfFifty.pem
chmod 600 ${{ github.workspace }}/HalfFifty.pem

# 6. SSH 연결 테스트
- name: Test SSH Connection
run: |
ssh -i HalfFifty.pem ubuntu@${{ secrets.AWS_IP }} "echo 'SSH connection successful'"


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

- name: Debug Key File
run: |
ls -la ${{ github.workspace }}/HalfFifty.pem
cat ${{ github.workspace }}/HalfFifty.pem

# 8. Docker Compose를 사용하여 EC2에서 배포
- name: Deploy to EC2 using Docker Compose
uses: appleboy/[email protected]
with:
host: ${{ secrets.AWS_IP }}
username: ${{ secrets.AWS_USER }}
key: HalfFifty.pem
key: ${{ github.workspace }}/HalfFifty.pem
script: |
cd ~
docker-compose down || true
Expand Down
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