From 144a8b87cd5cf96eec902fbc1d2279dd8b27075a Mon Sep 17 00:00:00 2001 From: Aarnav Tale Date: Sun, 22 Jun 2025 17:17:56 -0400 Subject: [PATCH] feat: cache docker build cache using gha --- .github/workflows/next.yaml | 4 +++- .github/workflows/release.yaml | 4 +++- Dockerfile | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/next.yaml b/.github/workflows/next.yaml index f77a1f8..dbabedd 100644 --- a/.github/workflows/next.yaml +++ b/.github/workflows/next.yaml @@ -45,7 +45,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile @@ -53,3 +53,5 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} platforms: linux/amd64, linux/arm64 + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 04bff84..e21be79 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -43,7 +43,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile @@ -51,3 +51,5 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} platforms: linux/amd64, linux/arm64 + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/Dockerfile b/Dockerfile index a224d81..b722f5c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,8 @@ FROM --platform=$BUILDPLATFORM mise-context AS go-build WORKDIR /build/ COPY go.mod go.sum ./ +RUN go mod download + COPY cmd/ ./cmd/ COPY internal/ ./internal/