From 4455eef9156875f239ed6fbe94beb7c111afdeab Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Fri, 26 Dec 2025 12:40:24 +0100 Subject: [PATCH] =?UTF-8?q?Ajoute=20la=20possibilit=C3=A9=20de=20pousser?= =?UTF-8?q?=20avec=20skopeo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- action.yaml | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/action.yaml b/action.yaml index c1a9ea2..7bc0258 100644 --- a/action.yaml +++ b/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: @@ -68,7 +68,7 @@ runs: registry_password: ${{ inputs.registry_password }} debug: ${{ inputs.debug }} - - name: Push the images to the serveur +- name: Push the images to the serveur shell: bash run: | source "${{ github.action_path }}/../bashlib.sh" @@ -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 - success "Image pushing" "${{ inputs.image_name }}:${tag}" + 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 - error "Failed" "pushing of image ${{ inputs.image_name }}:${tag}" + # 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 - -