Skip to content

Commit 99d5ed8

Browse files
feat: Add support for docker build-arg arguments. (#113)
Adds support for passing dockre build-arg as argument. Will be used to pass version/commit hash as build-arg for the netbox build. See https://github.com/docker/build-push-action#:~:text=setup%2Dbuildx%20action)-,build%2Dargs,-List Example of use: nrkno/plattform-terraform-netbox-config#810
2 parents 9a5ffd8 + e922537 commit 99d5ed8

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.github/workflows/workflow.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ on:
9393
type: boolean
9494
default: false
9595
description: Generate an SBOM of your dependencies and submit them to GitHub Dependency Graph.
96+
build-args:
97+
type: string
98+
default: ""
99+
description: Newline separated list of build arguments to pass to the Docker build.
96100
secrets:
97101
git-ssh-key:
98102
description: SSH key used by Git to checkout the repository.
@@ -187,6 +191,7 @@ jobs:
187191
push: false
188192
pull: true
189193
tags: ${{ inputs.name }}:${{ steps.setup.outputs.unique-id }}
194+
build-args: ${{ inputs.build-args }}
190195
outputs: type=docker
191196
-
192197
if: inputs.cache == true && !inputs.ssh-agent
@@ -198,6 +203,7 @@ jobs:
198203
push: false
199204
pull: true
200205
tags: ${{ inputs.name }}:${{ steps.setup.outputs.unique-id }}
206+
build-args: ${{ inputs.build-args }}
201207
outputs: type=docker
202208
cache-from: type=registry,ref=${{ inputs.registry-url }}/${{ inputs.name }}:${{ inputs.cache-tag }}
203209
cache-to: type=registry,ref=${{ inputs.registry-url }}/${{ inputs.name }}:${{ inputs.cache-tag }},mode=max,ignore-error=true
@@ -211,6 +217,7 @@ jobs:
211217
push: false
212218
pull: true
213219
tags: ${{ inputs.name }}:${{ steps.setup.outputs.unique-id }}
220+
build-args: ${{ inputs.build-args }}
214221
outputs: type=docker
215222
ssh: |
216223
default=${{ env.SSH_AUTH_SOCK }}
@@ -224,6 +231,7 @@ jobs:
224231
push: false
225232
pull: true
226233
tags: ${{ inputs.name }}:${{ steps.setup.outputs.unique-id }}
234+
build-args: ${{ inputs.build-args }}
227235
outputs: type=docker
228236
cache-from: type=registry,ref=${{ inputs.registry-url }}/${{ inputs.name }}:${{ inputs.cache-tag }}
229237
cache-to: type=registry,ref=${{ inputs.registry-url }}/${{ inputs.name }}:${{ inputs.cache-tag }},mode=max,ignore-error=true

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ jobs:
4848
- `trivy-severity` (string, default `"MEDIUM,HIGH,CRITICAL"`) - Comma-separated list of severities to consider an error.
4949
- `trivy-summary-enabled` (boolean, default `false`) - Render a table of all the Trivy findings in the GitHub summary for the workflow.
5050
- `trivy-sbom-enabled` (boolean, default `false`) - Generate an SBOM of your dependencies and submit them to GitHub Dependency Graph.
51+
- `build-args` (string, default `""`) - Newline separated list of build arguments to pass to the Docker build.
5152

5253
### Secrets
5354
- `git-ssh-key` - SSH key used by Git to checkout the repository.

0 commit comments

Comments
 (0)