From 2e9f21b6c39c76c59704f1d5d43db9831d177641 Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Tue, 13 Oct 2026 21:16:28 +0000 Subject: [PATCH] ci(image): Hand the production build cache over locally The production job builds the image four times (two registries, two variants). The first build exported every layer to the GitHub Actions cache (~90s) so the next three could reuse it, but nothing in that cache helps the next commit: the builder stage starts with `COPY . .`, and in the run I checked no step of the first build was cached. Write the first build's cache to the runner's disk instead and have the other three builds read it from there. Bump action-build-and-push-images to 3714f35, which provides the cache_from/cache_to inputs and skips QEMU for these native amd64 builds. Co-Authored-By: Joshua Li <14209781+joshuarli@users.noreply.github.com> --- .github/workflows/image.yaml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/image.yaml b/.github/workflows/image.yaml index 821c289e..f3ab6cc6 100644 --- a/.github/workflows/image.yaml +++ b/.github/workflows/image.yaml @@ -172,7 +172,7 @@ jobs: - uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v4.2.2 - name: Build and push image to single-region registry - uses: getsentry/action-build-and-push-images@dd9b907092cdd2dbc6c1a409f7290df1b391f6ee + uses: getsentry/action-build-and-push-images@3714f354c0bc912a95221f193c9643cdba966e34 with: image_name: 'vroom' platforms: linux/amd64 @@ -184,9 +184,14 @@ jobs: google_ar_image_name: us-central1-docker.pkg.dev/sentryio/vroom/vroom google_workload_identity_provider: projects/868781662168/locations/global/workloadIdentityPools/prod-github/providers/github-oidc-pool google_service_account: gha-vroom-push@sac-prod-sa.iam.gserviceaccount.com + # The builder stage starts with `COPY . .`, so nothing from a previous + # commit's cache is reusable. Skip the GitHub Actions cache and hand + # this build's cache to the next three builds on the runner's disk. + cache_from: '' + cache_to: type=local,dest=${{ runner.temp }}/vroom-buildcache,mode=max - name: Build and push image to multi-region registry - uses: getsentry/action-build-and-push-images@dd9b907092cdd2dbc6c1a409f7290df1b391f6ee + uses: getsentry/action-build-and-push-images@3714f354c0bc912a95221f193c9643cdba966e34 with: image_name: 'vroom' platforms: linux/amd64 @@ -198,9 +203,11 @@ jobs: google_ar_image_name: us-docker.pkg.dev/sentryio/vroom-mr/vroom google_workload_identity_provider: projects/868781662168/locations/global/workloadIdentityPools/prod-github/providers/github-oidc-pool google_service_account: gha-vroom-push@sac-prod-sa.iam.gserviceaccount.com + cache_from: type=local,src=${{ runner.temp }}/vroom-buildcache + cache_to: '' - name: Build and push distroless image to single-region registry - uses: getsentry/action-build-and-push-images@dd9b907092cdd2dbc6c1a409f7290df1b391f6ee + uses: getsentry/action-build-and-push-images@3714f354c0bc912a95221f193c9643cdba966e34 with: image_name: 'vroom' platforms: linux/amd64 @@ -214,9 +221,11 @@ jobs: google_ar_image_name: us-central1-docker.pkg.dev/sentryio/vroom/vroom google_workload_identity_provider: projects/868781662168/locations/global/workloadIdentityPools/prod-github/providers/github-oidc-pool google_service_account: gha-vroom-push@sac-prod-sa.iam.gserviceaccount.com + cache_from: type=local,src=${{ runner.temp }}/vroom-buildcache + cache_to: '' - name: Build and push distroless image to multi-region registry - uses: getsentry/action-build-and-push-images@dd9b907092cdd2dbc6c1a409f7290df1b391f6ee + uses: getsentry/action-build-and-push-images@3714f354c0bc912a95221f193c9643cdba966e34 with: image_name: 'vroom' platforms: linux/amd64 @@ -230,3 +239,5 @@ jobs: google_ar_image_name: us-docker.pkg.dev/sentryio/vroom-mr/vroom google_workload_identity_provider: projects/868781662168/locations/global/workloadIdentityPools/prod-github/providers/github-oidc-pool google_service_account: gha-vroom-push@sac-prod-sa.iam.gserviceaccount.com + cache_from: type=local,src=${{ runner.temp }}/vroom-buildcache + cache_to: ''