From c8a9eb6f1bfee3b6ce388280cfe1efc552c4447d Mon Sep 17 00:00:00 2001 From: ChuYong Date: Mon, 27 May 2024 15:28:13 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=EB=B9=8C=EB=93=9C=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-and-deploy.yaml | 48 +++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/build-and-deploy.yaml diff --git a/.github/workflows/build-and-deploy.yaml b/.github/workflows/build-and-deploy.yaml new file mode 100644 index 0000000..85fa249 --- /dev/null +++ b/.github/workflows/build-and-deploy.yaml @@ -0,0 +1,48 @@ +name: 이미지 빌드 & 푸쉬 +on: + push: + branches: [ 'develop', 'feature/#49' ] + paths: + - '.github/workflows/**' + - 'build.gradle.kts' + - 'settings.gradle.kts' + - 'src/**' + +env: + ACTIVE_PROFILE: prod + +jobs: + build: + runs-on: [ ubuntu-latest ] + name: 이미지 빌드하기 + + permissions: + id-token: write + contents: read + + steps: + - name: GitHub 에서 레포 받아오기 + uses: actions/checkout@v3 + + - name: JDK17 준비하기 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + + - name: 도커허브 로그인 + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Gradle 준비하기 + uses: gradle/gradle-build-action@v2 + + - name: 이미지 빌드하고 푸쉬하기 + id: build-image + run: | + chmod +x ./gradlew && + export IMAGE_TAG=$(git rev-parse --short HEAD) && + export IMAGE_NAME=${{ secrets.IMAGE_NAME }} && + ./gradlew jib