generated from pmo-actions/healthchecks-ping
Ajoute la possibilité de pousser avec skopeo
This commit is contained in:
21
action.yaml
21
action.yaml
@@ -1,5 +1,5 @@
|
||||
name: 'Build a docker image to a registry server'
|
||||
description: 'Build a docker image to a registry server using podman or docker'
|
||||
name: 'Push a docker image to a registry server'
|
||||
description: 'Push a docker image to a registry server using podman, docker, or skopeo'
|
||||
author: 'Eric Coissac'
|
||||
|
||||
inputs:
|
||||
@@ -86,12 +86,23 @@ runs:
|
||||
step "Start pushing" "${{ inputs.image_name }}"
|
||||
|
||||
for tag in "${tags[@]}" ; do
|
||||
if ${{ inputs.push_command }} push ${{ inputs.registry_server }}/${{ inputs.image_name }}:$tag ; then
|
||||
if [[ "${{ inputs.push_command }}" == "skopeo" ]] ; then
|
||||
# Pour skopeo, on utilise 'copy' avec docker-daemon: comme source
|
||||
source_image="docker-daemon:${{ inputs.registry_server }}/${{ inputs.image_name }}:${tag}"
|
||||
dest_image="docker://${{ inputs.registry_server }}/${{ inputs.image_name }}:${tag}"
|
||||
|
||||
if skopeo copy "${source_image}" "${dest_image}" ; then
|
||||
success "Image pushing" "${{ inputs.image_name }}:${tag}"
|
||||
else
|
||||
error "Failed" "pushing of image ${{ inputs.image_name }}:${tag}"
|
||||
fi
|
||||
else
|
||||
# Pour podman ou docker, on utilise la syntaxe classique 'push'
|
||||
if ${{ inputs.push_command }} push ${{ inputs.registry_server }}/${{ inputs.image_name }}:${tag} ; then
|
||||
success "Image pushing" "${{ inputs.image_name }}:${tag}"
|
||||
else
|
||||
error "Failed" "pushing of image ${{ inputs.image_name }}:${tag}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user