Skip to content

Commit aa071d2

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

File tree

1 file changed

+37
-41
lines changed

1 file changed

+37
-41
lines changed

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

Lines changed: 37 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -34,54 +34,50 @@ 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+
prepare-tag:
4138
runs-on: ubuntu-latest
42-
39+
outputs:
40+
service_extension_image_tag: ${{ steps.extract.outputs.service_extension_image_tag }}
41+
request_mirroring_image_tag: ${{ steps.extract.outputs.request_mirroring_image_tag }}
4342
steps:
44-
- name: Determine image tag
45-
id: image_tag
43+
- name: Extract raw/tag inputs
44+
id: extract
4645
env:
4746
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
47+
PREFIX_SERVICE_EXTENSION: contrib/envoyproxy/go-control-plane/
48+
PREFIX_REQUEST_MIRRORING: contrib/k8s.io/gateway-api/
49+
run: |
50+
echo "service_extension_image_tag=${RAW_TAG#PREFIX_SERVICE_EXTENSION}" >> $GITHUB_OUTPUT
51+
echo "request_mirroring_image_tag=${RAW_TAG#PREFIX_REQUEST_MIRRORING}" >> $GITHUB_OUTPUT
5052
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' || '' }}
53+
build-service-extensions-callout:
54+
needs: prepare-tag
55+
if: >
56+
github.event_name == 'push' && startsWith(github.ref, 'refs/tags/contrib/envoyproxy/go-control-plane')
57+
|| github.event.inputs.build_service_extensions == 'true'
58+
uses: ./.github/workflows/docker-build-and-push.yml
59+
with:
60+
image: ghcr.io/datadog/dd-trace-go/service-extensions-callout
61+
dockerfile: ./contrib/envoyproxy/go-control-plane/cmd/serviceextensions/Dockerfile
62+
artifact_prefix: service-extensions
63+
commit_sha: ${{ github.event.inputs.commit_sha || github.sha }}
64+
tags: >-
65+
${{ needs.prepare-tag.outputs.service_extension_image_tag }}
66+
${{ github.event.inputs.commit_sha || github.sha }}
67+
${{ (github.event.inputs.set_as_latest == 'true' || github.event_name == 'push') && 'latest' || '' }}
6268
6369
build-request-mirror:
70+
needs: prepare-tag
6471
if: >
6572
github.event_name == 'push' && startsWith(github.ref, 'refs/tags/contrib/k8s.io/gateway-api')
6673
|| github.event.inputs.build_request_mirror == 'true'
67-
runs-on: ubuntu-latest
68-
69-
steps:
70-
- name: Determine image tag
71-
id: image_tag
72-
env:
73-
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
76-
77-
- name: Build and Push Request Mirror Image
78-
uses: ./.github/workflows/docker-build-and-push.yml
79-
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
83-
commit_sha: ${{ github.event.inputs.commit_sha || github.sha }}
84-
tags: >-
85-
${{ github.event.inputs.tag_name || github.ref_name }}
86-
${{ github.event.inputs.commit_sha || github.sha }}
87-
${{ (github.event.inputs.set_as_latest == 'true' || github.event_name == 'push') && 'latest' || '' }}
74+
uses: ./.github/workflows/docker-build-and-push.yml
75+
with:
76+
image: ghcr.io/datadog/dd-trace-go/request-mirror
77+
dockerfile: ./contrib/k8s.io/cmd/request-mirror/Dockerfile
78+
artifact_prefix: request-mirror
79+
commit_sha: ${{ github.event.inputs.commit_sha || github.sha }}
80+
tags: >-
81+
${{ needs.prepare-tag.outputs.request_mirroring_image_tag }}
82+
${{ github.event.inputs.commit_sha || github.sha }}
83+
${{ (github.event.inputs.set_as_latest == 'true' || github.event_name == 'push') && 'latest' || '' }}

0 commit comments

Comments
 (0)