From fc645a718a4cbf83e49941ab3d9781f1eaeba72f Mon Sep 17 00:00:00 2001 From: ikjo39 Date: Thu, 28 Nov 2024 19:34:22 +0900 Subject: [PATCH] =?UTF-8?q?chore(backend-prod-cd.yml):=20Docker=20?= =?UTF-8?q?=EB=A9=80=ED=8B=B0=20=EC=95=84=ED=82=A4=ED=85=8D=EC=B2=98=20?= =?UTF-8?q?=EB=B9=8C=EB=93=9C=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend-prod-cd.yml | 32 +++++++++++++++------------ 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/.github/workflows/backend-prod-cd.yml b/.github/workflows/backend-prod-cd.yml index cd1924e0f..1ac820959 100644 --- a/.github/workflows/backend-prod-cd.yml +++ b/.github/workflows/backend-prod-cd.yml @@ -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 @@ -66,10 +72,6 @@ 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 @@ -77,19 +79,21 @@ jobs: 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