Skip to content

Commit b0caf1b

Browse files
committed
feat(actions/dockerhub-build-push): added push-latest and platforms options
1 parent 240b35e commit b0caf1b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

.github/actions/dockerhub-build-push/action.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ inputs:
2424
required: false
2525
description: "Docker build context"
2626
default: ${{ github.workspace }}
27+
platforms:
28+
required: false
29+
description: "Docker build platforms"
30+
default: linux/amd64,linux/arm64
31+
push-latest:
32+
required: false
33+
description: "Push latest tag"
34+
default: "true"
2735
runs:
2836
using: "composite"
2937
steps:
@@ -39,6 +47,7 @@ runs:
3947
env:
4048
IMAGE_NAME: ${{ inputs.image-name }}
4149
IMAGE_TAG: ${{ inputs.image-tag }}
50+
PUSH_LATEST: ${{ inputs.push-latest }}
4251
run: |
4352
if [ ! -z "$IMAGE_TAG" ]; then
4453
TAGS="$IMAGE_NAME:$IMAGE_TAG"
@@ -52,6 +61,9 @@ runs:
5261
echo "No matching condition for build, skipping."
5362
exit 0
5463
fi
64+
if [ "${PUSH_LATEST}" = "true" ]; then
65+
TAGS="$TAGS $IMAGE_NAME:latest"
66+
fi
5567
echo "tags=$TAGS" >> $GITHUB_OUTPUT
5668
5769
- name: Set up QEMU and Buildx
@@ -70,6 +82,7 @@ runs:
7082
uses: docker/build-push-action@v6
7183
with:
7284
push: true
85+
platforms: ${{ inputs.platforms }}
7386
file: ${{ inputs.dockerfile }}
7487
context: ${{ inputs.build-context }}
7588
tags: ${{ steps.vars.outputs.tags }}

0 commit comments

Comments
 (0)