From b01542461caefc3fe36246379994666a968e095e Mon Sep 17 00:00:00 2001 From: kallin Date: Thu, 6 Aug 2026 04:19:57 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20CI/=EB=B0=B0=ED=8F=AC=20Docker=20?= =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EB=B9=8C=EB=93=9C=EC=97=90=20Git?= =?UTF-8?q?Hub=20Actions=20=EC=BA=90=EC=8B=9C=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Docker 빌드 단계에 레이어 캐시가 없어 매번 의존성 재다운로드·전체 재컴파일이 발생하던 문제. docker/build-push-action + cache-from/cache-to: type=gha로 레이어를 캐싱하고, 배포 워크플로우는 CI가 같은 커밋으로 미리 써둔 캐시를 재사용하도록 함. --- .github/workflows/ci.yml | 11 ++++++++++- .github/workflows/deploy.yml | 5 +++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d47f4a6..fa6ef0b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,5 +33,14 @@ jobs: - name: Build and Test run: ./gradlew --no-daemon build + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build Docker image - run: docker build --tag promsearch:ci . + uses: docker/build-push-action@v6 + with: + context: . + tags: promsearch:ci + push: false + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b3c0c24..ed1922c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -27,6 +27,9 @@ jobs: with: ref: ${{ github.event.workflow_run.head_sha }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to Docker Hub uses: docker/login-action@v3 with: @@ -41,6 +44,8 @@ jobs: tags: | ${{ secrets.DOCKERHUB_USERNAME }}/promsearch:latest ${{ secrets.DOCKERHUB_USERNAME }}/promsearch:${{ github.event.workflow_run.head_sha }} + cache-from: type=gha + cache-to: type=gha,mode=max deploy: needs: build-and-push