Ensure each image has a separate cache. This allows later builds of that same image to inherit that cache.

This commit is contained in:
Tim Donohue
2024-12-06 15:01:08 -06:00
parent 24851eb103
commit faf92a293d

View File

@@ -159,8 +159,8 @@ jobs:
labels: ${{ steps.meta_build.outputs.labels }} labels: ${{ steps.meta_build.outputs.labels }}
# Use GitHub cache to load cached Docker images and cache the results of this build # Use GitHub cache to load cached Docker images and cache the results of this build
# This decreases the number of images we need to fetch from DockerHub # This decreases the number of images we need to fetch from DockerHub
cache-from: type=gha cache-from: type=gha,scope=${{ inputs.build_id }}
cache-to: type=gha,mode=max cache-to: type=gha,scope=${{ inputs.build_id }},mode=max
# Export the digest of Docker build locally (for non PRs only) # Export the digest of Docker build locally (for non PRs only)
- name: Export Docker build digest - name: Export Docker build digest
@@ -227,8 +227,8 @@ jobs:
labels: ${{ steps.meta_build.outputs.labels }} labels: ${{ steps.meta_build.outputs.labels }}
# Use GitHub cache to load cached Docker images and cache the results of this build # Use GitHub cache to load cached Docker images and cache the results of this build
# This decreases the number of images we need to fetch from DockerHub # This decreases the number of images we need to fetch from DockerHub
cache-from: type=gha cache-from: type=gha,scope=${{ inputs.build_id }}
cache-to: type=gha,mode=max cache-to: type=gha,scope=${{ inputs.build_id }},mode=max
# Export image to a local TAR file # Export image to a local TAR file
outputs: type=docker,dest=/tmp/${{ inputs.build_id }}.tar outputs: type=docker,dest=/tmp/${{ inputs.build_id }}.tar