From 5b2dd56324de29f848465ecfd26e394205137543 Mon Sep 17 00:00:00 2001 From: Jo Hyeong-Ik <70360890+ikjo39@users.noreply.github.com> Date: Thu, 28 Nov 2024 17:39:28 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20CD=20=ED=94=84=EB=A1=9C=EC=84=B8?= =?UTF-8?q?=EC=8A=A4=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend-prod-cd.yml | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/.github/workflows/backend-prod-cd.yml b/.github/workflows/backend-prod-cd.yml index 6e512420d..3dbbfa2d8 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 @@ -65,11 +71,7 @@ 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,6 +79,20 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + # Docker 이미지 빌드 & 푸시 + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/momo-api-prod + platforms: | + linux/amd64 + linux/arm64 + + - name: Docker image build + run: docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/momo-api-prod . + # Docker Hub 이미지 푸시 - name: Docker Hub push run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/momo-api-prod