diff --git a/action.yaml b/action.yaml index 853c951..b0f3def 100644 --- a/action.yaml +++ b/action.yaml @@ -17,6 +17,10 @@ inputs: description: 'Command used to build the image (docker|podman)' required: false default: docker + no_cache: + description: 'Do we desactivate cache during image duilding' + required: false + default: false tag_command: description: 'Command used to tag the image (docker|podman)' required: false @@ -69,7 +73,13 @@ runs: image="${{ inputs.registry_server }}/${{ inputs.image_name }}${sep}${tags[0]}" - if ${{ inputs.build_command }} build -t ${image} . ; then + if [[ ${{ input.no_cache }} == "true" ]] ; then + nocache="--no-cache" + else + nocache="" + fi + + if ${{ inputs.build_command }} build ${nocache} -t ${image} . ; then success "Image build" "${{ inputs.image_name }}" else error "Failed" "Cannot built the image ${{ inputs.image_name }}"