Skip to content

Commit 91a23f5

Browse files
authored
Merge pull request #41 from macbre/add/build-arg
Add the optional build-arg input
2 parents 575cc6b + f7be842 commit 91a23f5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

action.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ inputs:
4242
description: Image tag, e.g. latest. Will overwrite the tag latest tag on a push, and have no effect on a release.
4343
required: false
4444

45+
# https://docs.docker.com/build/guide/build-args/
46+
build_arg:
47+
description: Additional build argument to be passed to the Dockerfile (e.g. NODE_AUTH_TOKEN=s3cr3t)
48+
required: false
49+
default: "FOO=bar"
50+
4551
runs:
4652
using: "composite"
4753
steps:
@@ -84,7 +90,7 @@ runs:
8490
export BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
8591
export GITHUB_URL=https://github.com/${{ github.repository }}
8692
87-
echo "::group::Building the Docker image: ${{ inputs.repository }}/${IMAGE_NAME}:${COMMIT_TAG} from ${{ inputs.dockerfile }} in ${{ inputs.context}} context ..."
93+
echo "::group::Building the Docker image: ${{ inputs.repository }}/${IMAGE_NAME}:${COMMIT_TAG} from ${{ inputs.dockerfile }} in ${{ inputs.context }} context ..."
8894
8995
# https://docs.docker.com/develop/develop-images/build_enhancements/
9096
# https://docs.docker.com/engine/reference/commandline/build/#specifying-external-cache-sources
@@ -97,6 +103,8 @@ runs:
97103
--build-arg BUILD_DATE=${BUILD_DATE} \
98104
--build-arg GITHUB_SHA=${GITHUB_SHA} \
99105
\
106+
--build-arg ${{ inputs.build_arg }} \
107+
\
100108
--tag ${{ inputs.repository }}/${IMAGE_NAME}:${COMMIT_TAG} \
101109
--tag docker.io/${IMAGE_NAME}:${COMMIT_TAG} \
102110
\

0 commit comments

Comments
 (0)