Skip to content

Commit 62d5306

Browse files
committed
Split push image manifest
1 parent 90fdf7b commit 62d5306

File tree

2 files changed

+54
-2
lines changed

2 files changed

+54
-2
lines changed

.github/workflows/push-to-gar-docker-multiarch.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,16 @@ jobs:
117117
with:
118118
repository: ${{ env.action_repo }}
119119
ref: ${{ env.action_ref }}
120+
- name: Checkout
121+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
122+
with:
123+
repository: grafana/shared-workflows
124+
ref: multiarch-docker-builds-using-sh-runners
120125
path: shared-workflows
121-
- name: Download digests
122-
uses: actions/download-artifact@v4
126+
- name: Create and push image manifests
127+
uses: ./shared-workflows/actions/create-and-push-image-manifests
123128
with:
129+
<<<<<<< Updated upstream
124130
path: /tmp/digests
125131
pattern: digests-*-${{ matrix.tags }}
126132
merge-multiple: true
@@ -147,3 +153,7 @@ jobs:
147153
- name: Inspect image
148154
run: |
149155
"docker buildx imagetools inspect ${{ needs.build-multi-arch.outputs.full_image_name }}:${{ steps.meta.outputs.version }}"
156+
=======
157+
full-image-name: ${{ needs.build-multi-arch.outputs.full_image_name }}
158+
tag: ${{ matrix.tags }}
159+
>>>>>>> Stashed changes
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
description: Pulls image digests from GitHub and pushes manifests to GAR
3+
inputs:
4+
full-image-name:
5+
description: Image name to push the manifest for
6+
required: true
7+
tag:
8+
description: Tag to create and push the manifest for
9+
required: true
10+
name: Create and push image manifest
11+
12+
runs:
13+
using: composite
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
17+
- name: Download digests
18+
uses: actions/download-artifact@v4
19+
with:
20+
merge-multiple: true
21+
path: /tmp/digests
22+
pattern: digests-*-${{ inputs.tag }}
23+
- name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@v3
25+
- id: meta
26+
name: Docker meta
27+
uses: docker/metadata-action@v5
28+
with:
29+
images: ${{ inputs.full-image-name }}
30+
tags: ${{ inputs.tag }}
31+
- id: login-to-gar
32+
uses: grafana/shared-workflows/actions/login-to-gar@main
33+
- name: Create manifest list and push
34+
working-directory: /tmp/digests
35+
shell: bash
36+
run: |
37+
"docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(printf '${{ inputs.full-image-name }}@sha256:%s ' *)"
38+
- name: Inspect image
39+
shell: bash
40+
run: |
41+
"docker buildx imagetools inspect ${{ inputs.full-image-name }}:${{ steps.meta.outputs.version }}"
42+

0 commit comments

Comments
 (0)