53
53
- name : Setup Docker buildx
54
54
55
55
56
+ - name : Extract Docker cache metadata
57
+ id : meta-cache
58
+
59
+ with :
60
+ # list of Docker images to use as base name for tags
61
+ # <registry/<owner>/<repo_name>/<repo_name>-<target>
62
+ images : |
63
+ ${{ env.REGISTRY }}/${{ env.REGISTRY_PATH }}/${{ env.IMAGE_NAME }}-cache
64
+ tags : |
65
+ type=raw,value=tests
66
+
56
67
# Build but don't push Docker image with Buildx
57
68
# https://github.com/docker/build-push-action
58
69
- name : Build test image
63
74
load : true
64
75
target : dev
65
76
tags : ${{ env.TEST_TAG }}
66
- cache-from : type=registry,ref=${{ env.REGISTRY }}/${{ env.REGISTRY_PATH }}/${{ env.IMAGE_NAME }}-cache:tests
67
- cache-to : type=registry,ref=${{ env.REGISTRY }}/${{ env.REGISTRY_PATH }}/${{ env.IMAGE_NAME }}-cache:tests ,mode=max
77
+ cache-from : type=registry,ref=${{ steps.meta-cache.outputs.tags }}
78
+ cache-to : type=registry,ref=${{ steps.meta-cache.outputs.tags }},mode=max
68
79
69
80
# This is a barrier check to make sure we push a functional
70
81
# docker image, we can avoid linting
@@ -137,6 +148,16 @@ jobs:
137
148
images : |
138
149
${{ env.REGISTRY }}/${{ env.REGISTRY_PATH }}/${{ env.IMAGE_NAME }}-${{ matrix.docker_target }}
139
150
151
+ - name : Extract Docker cache metadata
152
+ id : meta-cache
153
+
154
+ with :
155
+ # list of Docker images to use as base name for tags
156
+ # <registry/<owner>/<repo_name>/<repo_name>-<target>
157
+ images : |
158
+ ${{ env.REGISTRY }}/${{ env.REGISTRY_PATH }}/${{ env.IMAGE_NAME }}-cache
159
+ tags : |
160
+ type=raw,value=buildcache-${{ matrix.docker_target }}-${{ env.PLATFORM_PAIR }}
140
161
141
162
# This build an image WITHOUT tags and outputs the digests, so that we can aggragate them later
142
163
- name : Build and push production image
@@ -149,8 +170,8 @@ jobs:
149
170
outputs : type=image,push-by-digest=true,name-canonical=true,push=true
150
171
tags : ${{ env.REGISTRY }}/${{ env.REGISTRY_PATH }}/${{ env.IMAGE_NAME }}-${{ matrix.docker_target }}
151
172
labels : ${{ steps.meta.outputs.labels }}
152
- cache-from : type=registry,ref=${{ env.REGISTRY }}/${{ env.REGISTRY_PATH }}/${{ env.IMAGE_NAME }} -cache:buildcache-${{ matrix.docker_target }}-${{ env.PLATFORM_PAIR }}
153
- cache-to : type=registry,ref=${{ env.REGISTRY }}/${{ env.REGISTRY_PATH }}/${{ env.IMAGE_NAME }} -cache:buildcache-${{ matrix.docker_target }}-${{ env.PLATFORM_PAIR }},mode=max
173
+ cache-from : type=registry,ref=${{ steps.meta -cache.outputs.tags }}
174
+ cache-to : type=registry,ref=${{ steps.meta -cache.outputs.tags }},mode=max
154
175
155
176
- name : Export digest
156
177
run : |
0 commit comments