Skip to content

Commit 1ad553d

Browse files
committed
perf: cache to/from repository
1 parent 62c87a9 commit 1ad553d

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

.github/workflows/az_acr_push.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ jobs:
6060
push: true
6161
file: ${{ (matrix.platform == 'arm64' && hashFiles('Dockerfile.arm64') != '') && 'Dockerfile.arm64' || 'Dockerfile' }}
6262
tags: ${{ env.AZURE_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:${{ matrix.platform }}-${{ steps.branch_name.outputs.GH_REF_NAME }}
63-
cache-from: type=gha
64-
cache-to: type=gha,mode=max
63+
cache-from: type=registry,ref=${{ env.AZURE_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:dockercache
64+
cache-to: type=registry,ref=${{ env.AZURE_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:dockercache,mode=max,image-manifest=true
6565
platforms: linux/${{ matrix.platform }}
6666
build-args: |
6767
platform=linux/${{ matrix.platform }}
@@ -74,8 +74,8 @@ jobs:
7474
push: true
7575
file: 'gpu.Dockerfile'
7676
tags: ${{ env.AZURE_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:${{ matrix.platform }}-gpu
77-
cache-from: type=gha
78-
cache-to: type=gha,mode=max
77+
cache-from: type=registry,ref=${{ env.AZURE_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:dockercache
78+
cache-to: type=registry,ref=${{ env.AZURE_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:dockercache,mode=max,image-manifest=true
7979
platforms: linux/${{ matrix.platform }}
8080
build-args: |
8181
platform=linux/${{ matrix.platform }}

.github/workflows/az_acr_release.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ jobs:
5252
if: ${{ github.event_name != 'release' }}
5353
uses: docker/build-push-action@v5
5454
with:
55-
cache-from: type=gha
56-
cache-to: type=gha,mode=max
55+
cache-from: type=registry,ref=${{ env.AZURE_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:dockercache
56+
cache-to: type=registry,ref=${{ env.AZURE_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:dockercache,mode=max,image-manifest=true
5757
platforms: linux/amd64
5858
file: ${{ env.DOCKERFILE }}
5959
tags: ${{ env.AZURE_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:amd64
@@ -66,8 +66,8 @@ jobs:
6666
if: ${{ github.event_name != 'release' }}
6767
uses: docker/build-push-action@v5
6868
with:
69-
cache-from: type=gha
70-
cache-to: type=gha,mode=max
69+
cache-from: type=registry,ref=${{ env.AZURE_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:dockercache
70+
cache-to: type=registry,ref=${{ env.AZURE_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:dockercache,mode=max,image-manifest=true
7171
platforms: linux/arm64
7272
file: ${{ env.DOCKERFILE }}
7373
tags: ${{ env.AZURE_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:arm64
@@ -79,8 +79,8 @@ jobs:
7979
- name: Build & Push ${{ github.event.repository.name }}:${{ env.IMAGE_TAG }}
8080
uses: docker/build-push-action@v5
8181
with:
82-
cache-from: type=gha
83-
cache-to: type=gha,mode=max
82+
cache-from: type=registry,ref=${{ env.AZURE_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:dockercache
83+
cache-to: type=registry,ref=${{ env.AZURE_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:dockercache,mode=max,image-manifest=true
8484
platforms: linux/amd64
8585
file: ${{ env.DOCKERFILE }}
8686
tags: ${{ env.AZURE_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:${{ env.IMAGE_TAG }}
@@ -92,8 +92,8 @@ jobs:
9292
- name: Build & Push ${{ github.event.repository.name }}:latest
9393
uses: docker/build-push-action@v5
9494
with:
95-
cache-from: type=gha
96-
cache-to: type=gha,mode=max
95+
cache-from: type=registry,ref=${{ env.AZURE_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:dockercache
96+
cache-to: type=registry,ref=${{ env.AZURE_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:dockercache,mode=max,image-manifest=true
9797
platforms: linux/amd64
9898
file: ${{ env.DOCKERFILE }}
9999
tags: ${{ env.AZURE_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:latest

.github/workflows/az_acr_test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ jobs:
4141
- name: Build & Push ${{ github.event.repository.name }}:test-${{ steps.branch_name.outputs.GH_REF_NAME }}
4242
uses: docker/build-push-action@v5
4343
with:
44-
cache-from: type=gha
45-
cache-to: type=gha,mode=max
44+
cache-from: type=registry,ref=${{ env.AZURE_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:dockercache
45+
cache-to: type=registry,ref=${{ env.AZURE_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:dockercache,mode=max,image-manifest=true
4646
file: 'dev.Dockerfile'
4747
tags: ${{ env.AZURE_CONTAINER_REGISTRY }}/${{ github.event.repository.name }}:test-${{ steps.branch_name.outputs.GH_REF_NAME }}
4848
push: true

0 commit comments

Comments
 (0)