feat(ci): run optional Dockerfile test targets
Runner Canary / runner-canary (push) Successful in 1s
Runner Canary / runner-canary (push) Successful in 1s
This commit is contained in:
@@ -25,6 +25,11 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
default: ""
|
default: ""
|
||||||
type: string
|
type: string
|
||||||
|
test_target:
|
||||||
|
description: Optional Dockerfile target that performs build-time tests
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
type: string
|
||||||
deploy_service:
|
deploy_service:
|
||||||
description: Dev service to candidate-test and promote
|
description: Dev service to candidate-test and promote
|
||||||
required: false
|
required: false
|
||||||
@@ -73,6 +78,10 @@ jobs:
|
|||||||
if [ -n "${{ inputs.cache_image }}" ]; then
|
if [ -n "${{ inputs.cache_image }}" ]; then
|
||||||
cache_args+=(--cache-from "${{ inputs.cache_image }}")
|
cache_args+=(--cache-from "${{ inputs.cache_image }}")
|
||||||
fi
|
fi
|
||||||
|
if [ -n "${{ inputs.test_target }}" ]; then
|
||||||
|
docker build --pull=false "${cache_args[@]}" --target "${{ inputs.test_target }}" \
|
||||||
|
-f "${{ inputs.dockerfile }}" "${{ inputs.build_context }}"
|
||||||
|
fi
|
||||||
docker build --pull=false "${cache_args[@]}" -f "${{ inputs.dockerfile }}" \
|
docker build --pull=false "${cache_args[@]}" -f "${{ inputs.dockerfile }}" \
|
||||||
-t "${{ inputs.image_name }}:sha-${{ gitea.sha }}" "${{ inputs.build_context }}"
|
-t "${{ inputs.image_name }}:sha-${{ gitea.sha }}" "${{ inputs.build_context }}"
|
||||||
docker push "${{ inputs.image_name }}:sha-${{ gitea.sha }}"
|
docker push "${{ inputs.image_name }}:sha-${{ gitea.sha }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user