-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
23 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,13 @@ jobs: | |
- name: Build with Gradle Wrapper | ||
run: ./gradlew -x test bootJar | ||
|
||
docker: | ||
runs-on: ubuntu-latest | ||
needs: build # build 작업이 완료되어야 실행 | ||
permissions: | ||
contents: read | ||
|
||
steps: | ||
# 4. Docker Buildx 설정 | ||
- name: Set up Docker Build | ||
uses: docker/setup-buildx-action@v1 | ||
|
@@ -39,19 +46,30 @@ jobs: | |
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_TOKEN }} | ||
|
||
# 6. Docker 이미지 빌드 및 배포 | ||
- name: Build and push Docker image | ||
# 6. Docker 이미지 빌드 | ||
- name: Build Docker image | ||
run: | | ||
docker build -t ${{ secrets.DOCKER_USERNAME }}/rankitrun-be:latest . | ||
# 7. Docker 이미지 푸시 | ||
- name: Push Docker image | ||
run: | | ||
docker push ${{ secrets.DOCKER_USERNAME }}/rankitrun-be:latest | ||
# 7. EC2 SSH 접속을 위한 키 등록 | ||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: docker # docker 작업이 완료되어야 실행 | ||
permissions: | ||
contents: read | ||
|
||
steps: | ||
# 8. EC2 SSH 접속을 위한 키 등록 | ||
- name: Set up SSH key | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.EC2_SSH_KEY }} | ||
|
||
# 8. EC2에 blue green 무중단 배포를 위한 스크립트 실행 | ||
# 9. EC2에 blue green 무중단 배포를 위한 스크립트 실행 | ||
- name: Run dPlanner.sh for CICD and switch blue-green container | ||
run: | | ||
ssh -o StrictHostKeyChecking=no ec2-user@${{ secrets.EC2_HOST }} << 'EOF' | ||
|