Skip to content

Commit aa59ade

Browse files
committed
build and push multiplatform
1 parent 519da37 commit aa59ade

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

.github/workflows/release.yaml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ on:
55
release:
66
types: ["published"]
77
tags: ["[0-9]+.*"]
8-
98
workflow_call:
109
inputs:
1110
dockerhub_repo:
@@ -52,6 +51,17 @@ jobs:
5251
username: ${{ github.repository_owner }}
5352
password: ${{ secrets.GITHUB_TOKEN }}
5453

54+
- name: Generate Docker metadata
55+
id: docker_metatdata
56+
uses: docker/metadata-action@v3
57+
with:
58+
images:
59+
- ghcr.io/${{ github.repository }}/otelcol-custom
60+
- puckpuck/otelcol-custom
61+
tags:
62+
- type=raw,value=${{ github.ref_name }}
63+
- type=raw,value=latest
64+
5565
# Build and push Docker image with Buildx (don't push on PR)
5666
# https://github.com/docker/build-push-action
5767
- name: Build and push Docker image
@@ -61,10 +71,6 @@ jobs:
6171
context: .
6272
platforms: linux/arm64,linux/amd64
6373
push: true
64-
tags: |
65-
${{ inputs.dockerhub_repo }}:${{ github.event.release.tag_name }}
66-
${{ inputs.dockerhub_repo }}:latest
67-
${{ inputs.ghcr_repo }}:${{ github.event.release.tag_name }}
68-
${{ inputs.ghcr_repo }}:latest
74+
tags: ${{ steps.docker_metatdata.outputs.tags }}
6975
cache-from: type=gha
7076
cache-to: type=gha

0 commit comments

Comments
 (0)