allow for extra build-args
This commit is contained in:
@@ -31,6 +31,11 @@ on:
|
||||
required: false
|
||||
type: string
|
||||
default: development
|
||||
extra-build-args:
|
||||
description: "Extra build args to pass to the Docker build, separate by space"
|
||||
required: false
|
||||
type: string
|
||||
default: ""
|
||||
|
||||
secrets:
|
||||
PASSWORD:
|
||||
@@ -43,6 +48,7 @@ env:
|
||||
LABEL: ${{ inputs.package-label }}
|
||||
ARTIFACT_UPLOAD: ${{ env.ACT_EXEC == 'true' && 'actions/upload-artifact@v2' || 'actions/upload-artifact@v3' }}
|
||||
ARTIFACT_DOWNLOAD: ${{ env.ACT_EXEC == 'true' && 'actions/download-artifact@v2' || 'actions/download-artifact@v3' }}
|
||||
EXTRA_ARGS: ${{ inputs.extra-build-args }}
|
||||
|
||||
jobs:
|
||||
|
||||
@@ -71,7 +77,14 @@ jobs:
|
||||
|
||||
- name: Build container
|
||||
run: |
|
||||
buildah build -f ${{inputs.dockerfile}} --build-arg GIT_TOKEN=${{secrets.GIT_TOKEN}} --build-arg VERSION=${{inputs.version}} -t gitea.ampenberger.com/${{inputs.git_user}}/${PACKAGE_NAME}:${LABEL}
|
||||
# split the extra-args and construct build-arg parameters
|
||||
set -- ${EXTRA_ARGS}
|
||||
args=""
|
||||
for p in "$@"; do
|
||||
args="$args --build-arg ${p}"
|
||||
done
|
||||
|
||||
buildah build -f ${{inputs.dockerfile}} --build-arg GIT_TOKEN=${{secrets.GIT_TOKEN}} --build-arg VERSION=${{inputs.version}} ${args} -t gitea.ampenberger.com/${{inputs.git_user}}/${PACKAGE_NAME}:${LABEL}
|
||||
|
||||
echo "Built ${PACKAGE_NAME}:${LABEL}"
|
||||
buildah images
|
||||
|
||||
Reference in New Issue
Block a user