feat: cache docker build cache using gha

This commit is contained in:
Aarnav Tale
2025-06-22 17:17:56 -04:00
parent 2bf088b4a9
commit 144a8b87cd
3 changed files with 8 additions and 2 deletions
+3 -1
View File
@@ -45,7 +45,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image - name: Build and push Docker image
uses: docker/build-push-action@v5 uses: docker/build-push-action@v6
with: with:
context: . context: .
file: ./Dockerfile file: ./Dockerfile
@@ -53,3 +53,5 @@ jobs:
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64, linux/arm64 platforms: linux/amd64, linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
+3 -1
View File
@@ -43,7 +43,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image - name: Build and push Docker image
uses: docker/build-push-action@v5 uses: docker/build-push-action@v6
with: with:
context: . context: .
file: ./Dockerfile file: ./Dockerfile
@@ -51,3 +51,5 @@ jobs:
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64, linux/arm64 platforms: linux/amd64, linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
+2
View File
@@ -6,6 +6,8 @@ FROM --platform=$BUILDPLATFORM mise-context AS go-build
WORKDIR /build/ WORKDIR /build/
COPY go.mod go.sum ./ COPY go.mod go.sum ./
RUN go mod download
COPY cmd/ ./cmd/ COPY cmd/ ./cmd/
COPY internal/ ./internal/ COPY internal/ ./internal/