Skip to content

Commit 2c3ed4f

Browse files
committed
docker tag intermediate platform-specific images
1 parent 10723f9 commit 2c3ed4f

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,15 @@ jobs:
6969
steps:
7070
- name: Checkout
7171
uses: actions/checkout@v4
72+
- id: suffix
73+
name: Cache name suffix
74+
run: echo "suffix=-$(tr '/' '-' <<< ${{ matrix.platform }})" >> "$GITHUB_OUTPUT"
7275
- name: Docker meta
7376
id: meta
7477
uses: docker/metadata-action@v5
7578
with:
7679
images: ${{ env.REGISTRY_IMAGE }}
80+
flavor: suffix=${{ steps.suffix.outputs.suffix }}
7781
- name: Set up QEMU
7882
uses: docker/setup-qemu-action@v3
7983
- name: Set up Docker Buildx
@@ -83,18 +87,17 @@ jobs:
8387
with:
8488
username: ${{ env.REGISTRY_USERNAME }}
8589
password: ${{ secrets.DOCKERHUB_TOKEN }}
86-
- id: cache_name
87-
run: echo "img=${{ env.REGISTRY_IMAGE }}:cache-$(tr '/' '-' <<< ${{ matrix.platform }})" >> "$GITHUB_OUTPUT"
8890
- name: Build and push by digest
8991
id: build
9092
uses: docker/build-push-action@v5
9193
with:
9294
context: .
9395
platforms: ${{ matrix.platform }}
9496
labels: ${{ steps.meta.outputs.labels }}
95-
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
96-
cache-from: type=registry,ref=${{ steps.cache_name.outputs.img }}
97-
cache-to: type=registry,ref=${{ steps.cache_name.outputs.img }},compression=zstd,mode=max
97+
push: true
98+
tags: ${{ steps.meta.outputs.tags }}
99+
cache-from: type=registry,ref=${{ env.REGISTRY_IMAGE }}:main-${{ steps.suffix.outputs.suffix }}
100+
cache-to: type=registry,ref=${{ env.REGISTRY_IMAGE }}:main-${{ steps.suffix.outputs.suffix }},compression=zstd,mode=max
98101
- name: Export digest
99102
run: |
100103
mkdir -p /tmp/digests

0 commit comments

Comments
 (0)