Skip to content

Commit

Permalink
chore(backend-prod-cd.yml): Docker 멀티 아키텍처 빌드로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
ikjo39 committed Nov 28, 2024
1 parent bd09442 commit fc645a7
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions .github/workflows/backend-prod-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ jobs:
java-version: '17'
distribution: 'temurin'
cache: gradle

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

Expand All @@ -66,30 +72,28 @@ jobs:
- name: Build with Gradle (clean)
run: ./gradlew clean bootJar

# Docker 이미지 빌드
- name: Docker image build
run: docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/momo-api-prod .

# DockerHub 로그인
- name: Docker login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# Docker Hub 이미지 푸시
- name: Docker Hub push
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/momo-api-prod
# Docker 이미지 빌드 & 푸시
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./backend
file: ./backend/Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/momo-api-prod
platforms: |
linux/amd64
linux/arm64
be-depoly:
needs: be-build
strategy:
matrix:
# 매트릭스 전략으로 여러 runner를 사용할 수 있도록 설정
runner: [ prod-a, prod-b ]
# fail-fast 옵션을 명시적으로 설정
fail-fast: true
runs-on: [ self-hosted, linux, ARM64, "${{ matrix.runner }}" ]
runs-on: [ self-hosted, linux, prod ]
defaults:
run:
shell: bash
Expand Down

0 comments on commit fc645a7

Please sign in to comment.