Skip to content

Commit d6b6583

Browse files
committed
release on tag
1 parent 611ddcb commit d6b6583

File tree

1 file changed

+29
-37
lines changed

1 file changed

+29
-37
lines changed

.github/workflows/docker-images-release.yml

Lines changed: 29 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -34,54 +34,46 @@ permissions:
3434
packages: write
3535

3636
jobs:
37-
build-service-extensions-callout:
38-
if: >
39-
github.event_name == 'push' && startsWith(github.ref, 'refs/tags/contrib/envoyproxy/go-control-plane')
40-
|| github.event.inputs.build_service_extensions == 'true
37+
build-images:
4138
runs-on: ubuntu-latest
39+
strategy:
40+
matrix:
41+
include:
42+
- name: service-extensions-callout
43+
prefix: contrib/envoyproxy/go-control-plane/
44+
build_input: build_service_extensions
45+
image: ghcr.io/datadog/dd-trace-go/service-extensions-callout
46+
dockerfile: ./contrib/envoyproxy/go-control-plane/cmd/serviceextensions/Dockerfile
47+
artifact_prefix: service-extensions
48+
- name: request-mirror
49+
prefix: contrib/k8s.io/gateway-api/
50+
build_input: build_request_mirror
51+
image: ghcr.io/datadog/dd-trace-go/request-mirror
52+
dockerfile: ./contrib/k8s.io/cmd/request-mirror/Dockerfile
53+
artifact_prefix: request-mirror
4254

43-
steps:
44-
- name: Determine image tag
45-
id: image_tag
46-
env:
47-
RAW_TAG: ${{ github.event.inputs.tag_name || github.ref_name }}
48-
PREFIX: contrib/envoyproxy/go-control-plane/
49-
run: echo "image_tag=${RAW_TAG#$PREFIX}" >> $GITHUB_OUTPUT
50-
51-
- name: Build and Push Service Extensions Callout Image
52-
uses: ./.github/workflows/docker-build-and-push.yml
53-
with:
54-
image: ghcr.io/datadog/dd-trace-go/service-extensions-callout
55-
dockerfile: ./contrib/envoyproxy/go-control-plane/cmd/serviceextensions/Dockerfile
56-
artifact_prefix: service-extensions
57-
commit_sha: ${{ github.event.inputs.commit_sha || github.sha }}
58-
tags: >-
59-
${{ steps.image_tag.outputs.image_tag }}
60-
${{ github.event.inputs.commit_sha || github.sha }}
61-
${{ (github.event.inputs.set_as_latest == 'true' || github.event_name == 'push') && 'latest' || '' }}
62-
63-
build-request-mirror:
6455
if: >
65-
github.event_name == 'push' && startsWith(github.ref, 'refs/tags/contrib/k8s.io/gateway-api')
66-
|| github.event.inputs.build_request_mirror == 'true'
67-
runs-on: ubuntu-latest
56+
(github.event_name == 'push'
57+
&& startsWith(github.ref, format('refs/tags/{0}', matrix.prefix)))
58+
|| github.event.inputs[matrix.build_input] == 'true'
6859
6960
steps:
7061
- name: Determine image tag
71-
id: image_tag
62+
id: extract_tag
7263
env:
7364
RAW_TAG: ${{ github.event.inputs.tag_name || github.ref_name }}
74-
PREFIX: contrib/k8s.io/gateway-api/
75-
run: echo "image_tag=${RAW_TAG#$PREFIX}" >> $GITHUB_OUTPUT
65+
PREFIX: ${{ matrix.prefix }}
66+
run: |
67+
echo "image_tag=${RAW_TAG#$PREFIX}" >> $GITHUB_OUTPUT
7668
77-
- name: Build and Push Request Mirror Image
69+
- name: Build & push ${{ matrix.name }}
7870
uses: ./.github/workflows/docker-build-and-push.yml
7971
with:
80-
image: ghcr.io/datadog/dd-trace-go/request-mirror
81-
dockerfile: ./contrib/k8s.io/cmd/request-mirror/Dockerfile
82-
artifact_prefix: request-mirror
72+
image: ${{ matrix.image }}
73+
dockerfile: ${{ matrix.dockerfile }}
74+
artifact_prefix: ${{ matrix.artifact_prefix }}
8375
commit_sha: ${{ github.event.inputs.commit_sha || github.sha }}
84-
tags: >-
85-
${{ github.event.inputs.tag_name || github.ref_name }}
76+
tags: |
77+
${{ steps.extract_tag.outputs.image_tag }}
8678
${{ github.event.inputs.commit_sha || github.sha }}
8779
${{ (github.event.inputs.set_as_latest == 'true' || github.event_name == 'push') && 'latest' || '' }}

0 commit comments

Comments
 (0)