Skip to content

Commit 6af7081

Browse files
committed
gha: only push to ECR on git tags
Signed-off-by: Ivo Jimenez <[email protected]>
1 parent 0fc44b7 commit 6af7081

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/docker-image.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
# list of Docker images to use as base name for tags
3838
images: |
3939
redpandadata/kminion
40-
public.ecr.aws/l9j0i2e0/kminion
40+
name=public.ecr.aws/l9j0i2e0/kminion,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
4141
# generate Docker tags based on the following events/attributes
4242
# Semver type is only active on 'push tag' events,
4343
# hence no enable condition required
@@ -49,10 +49,12 @@ jobs:
4949
username: ${{ env.DOCKERHUB_USER }}
5050
password: ${{ env.DOCKERHUB_TOKEN }}
5151
- uses: aws-actions/configure-aws-credentials@v4
52+
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
5253
with:
5354
aws-region: us-east-1
5455
role-to-assume: arn:aws:iam::${{ secrets.RP_AWS_CRED_ACCOUNT_ID }}:role/${{ vars.RP_AWS_CRED_BASE_ROLE_NAME }}${{ github.event.repository.name }}
5556
- uses: aws-actions/amazon-ecr-login@v2
57+
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
5658
with:
5759
registry-type: public
5860
- uses: docker/build-push-action@v6

0 commit comments

Comments
 (0)