Skip to content

Commit 422fa17

Browse files
authored
Add build-args input to docker-publish workflow (#28)
* add build-args input for docker-publish workflow * use newline-delimited string as used by build-push-action https://github.com/docker/build-push-action?tab=readme-ov-file#inputs * don't add build-args to test-docker-publish, to check backward compatibility
1 parent efc35a9 commit 422fa17

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

.github/workflows/docker-publish.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ on:
2020
description: 'Determines if the resulting Docker image is pushed to Docker Hub'
2121
required: true
2222
type: boolean
23+
build-args:
24+
# Example of newline-delimited string (https://github.com/docker/build-push-action?tab=readme-ov-file#inputs):
25+
# build-args: |
26+
# PROJECT_VERSION=1.2.3
27+
description: 'List of Docker build arguments (--build-arg), formatted as newline-delimited string'
28+
required: false
29+
type: string
2330
context:
2431
description: 'Docker build context'
2532
required: false
@@ -85,6 +92,8 @@ jobs:
8592
name: Build and push Docker image
8693
uses: docker/build-push-action@v6
8794
with:
95+
# https://github.com/docker/build-push-action?tab=readme-ov-file#inputs
96+
build-args: ${{ inputs.build-args }}
8897
context: ${{ inputs.context }}
8998
# https://docs.docker.com/build/concepts/dockerfile/#filename
9099
file: ${{ inputs.file }}

0 commit comments

Comments
 (0)