Skip to content

Commit

Permalink
[All] 운영환경 이관으로 인한 CI/CD 설정을 수정해요 :( (#441)
Browse files Browse the repository at this point in the history
* chore(Dockerfile): 제한된 아키텍처 설정 삭제

* chore(backend-prod-cd.yml): Docker 멀티 아키텍처 빌드로 변경
  • Loading branch information
ikjo39 authored Nov 28, 2024
1 parent 0e00ebe commit e74e883
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 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
2 changes: 1 addition & 1 deletion backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=linux/arm64 openjdk:17-ea-11
FROM openjdk:17-ea-11

ARG SECURITY_VOLUME=/momo/security
ENV SECURITY_PATH=$SECURITY_VOLUME
Expand Down

0 comments on commit e74e883

Please sign in to comment.