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