Skip to content

Commit c0c8142

Browse files
authored
Add manual Docker image builds with SHA tags for customer hotfixes (#509)
1 parent b61229a commit c0c8142

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

.github/workflows/release-docker.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: "Release Docker images"
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches: ["main"]
67
tags:
@@ -128,6 +129,14 @@ jobs:
128129
- name: Set up Docker Buildx
129130
uses: docker/setup-buildx-action@v3
130131

132+
- name: Push SHA tag (workflow_dispatch only)
133+
if: github.event_name == 'workflow_dispatch'
134+
working-directory: ${{ runner.temp }}/digests
135+
run: |
136+
SHORT_SHA="sha-$(echo ${{ github.sha }} | cut -c1-7)"
137+
docker buildx imagetools create -t ${{ env.REGISTRY_IMAGE }}:$SHORT_SHA \
138+
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
139+
131140
- name: Snapshot metadata
132141
if: github.ref == 'refs/heads/main'
133142
uses: docker/metadata-action@v5
@@ -150,6 +159,7 @@ jobs:
150159
type=raw,value=${{ env.MAJOR }}
151160
152161
- name: Create manifest list and push
162+
if: github.event_name != 'workflow_dispatch'
153163
working-directory: ${{ runner.temp }}/digests
154164
run: |
155165
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \

0 commit comments

Comments
 (0)