Add build args #1
@ -15,6 +15,10 @@ on:
|
||||
required: false
|
||||
type: string
|
||||
default: ${{ vars.REGISTRY_PASSWORD }}
|
||||
build-args:
|
||||
required: false
|
||||
type: string
|
||||
default: ""
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@ -34,6 +38,19 @@ jobs:
|
||||
username: ${{ inputs.username }}
|
||||
password: ${{ inputs.password }}
|
||||
- name: Build
|
||||
run: docker build . -t ${{ vars.REGISTRY }}/${{ gitea.repository }}:${{ inputs.tag }} -t ${{ vars.REGISTRY }}/${{ gitea.repository }}:${{ gitea.sha }}
|
||||
run: |
|
||||
BUILD_ARGS=""
|
||||
while IFS= read -r line; do
|
||||
echo "LINE CONTENT: $line"
|
||||
if [ -n "$line" ]; then
|
||||
BUILD_ARGS="$BUILD_ARGS --build-arg $line"
|
||||
fi
|
||||
done <<EOF
|
||||
${{ inputs.build-args }}
|
||||
EOF
|
||||
echo "Final BUILD_ARGS: $BUILD_ARGS"
|
||||
docker build . $BUILD_ARGS \
|
||||
-t ${{ vars.REGISTRY }}/${{ gitea.repository }}:${{ inputs.tag }} \
|
||||
-t ${{ vars.REGISTRY }}/${{ gitea.repository }}:${{ gitea.sha }}
|
||||
- name: Push
|
||||
run: docker push ${{ vars.REGISTRY }}/${{ gitea.repository }} --all-tags
|
||||
|
Loading…
x
Reference in New Issue
Block a user