Files

68 lines
2.0 KiB
YAML
Raw Permalink Normal View History

2025-04-14 08:41:32 +02:00
name: 'Connect to a docker registry'
2025-12-26 14:50:43 +01:00
description: 'Connection to a docker registry using podman, docker or skopeo'
2025-04-14 08:29:20 +02:00
author: 'Eric Coissac'
inputs:
2025-04-14 09:05:27 +02:00
registry_command:
description: 'command used to realise the login'
required: false
2025-12-26 14:50:43 +01:00
default: 'skopeo'
2025-04-14 08:41:32 +02:00
registry_server:
description: 'Address of the image registry server'
2025-04-14 08:29:20 +02:00
required: false
2025-04-14 08:41:32 +02:00
default: "niepce.petite-maison-orange.fr"
registry_user:
description: 'User used for the connection to the image registry'
2025-04-14 08:29:20 +02:00
required: false
2025-04-14 08:41:32 +02:00
default: ${{ secrets.PMO_REGISTRY_USER }}
registry_password:
description: 'Password used for the connection to the image registry'
required: false
default: ${{ secrets.PMO_REGISTRY_PASSWORD }}
2025-04-14 10:37:46 +02:00
debug:
description: 'Run the action in debug mode'
required: false
default: false
type: boolean
2025-04-14 08:41:32 +02:00
2025-04-14 08:29:20 +02:00
runs:
using: 'composite'
steps:
2025-04-14 12:35:45 +02:00
- name: Load bash library
uses: https://gargoton.petite-maison-orange.fr/pmo-actions/bash-library@main
2025-04-14 10:37:46 +02:00
- name: Set debug mode
2025-04-14 15:38:37 +02:00
if: inputs.debug == 'true'
2025-04-14 10:37:46 +02:00
shell: bash
run: |
2025-04-14 12:35:45 +02:00
source "${{ github.action_path }}/../bashlib.sh"
2025-04-14 10:37:46 +02:00
export DEBUG="ON"
echo "DEBUG=ON" >> $GITEA_ENV
debug Debug switch on
2025-12-26 15:12:31 +01:00
- name: Install container tool
uses: https://gargoton.petite-maison-orange.fr/pmo-actions/install-container-tools@main
with:
tools: ${{ inputs.registry_command }}
debug: ${{ inputs.debug }}
2025-12-26 14:50:43 +01:00
- name: Connection to the registry
2025-04-14 08:29:20 +02:00
shell: bash
run: |
2025-04-14 12:35:45 +02:00
source "${{ github.action_path }}/../bashlib.sh"
2025-04-14 10:37:46 +02:00
check_command ${{ inputs.registry_command }}
2025-04-14 09:07:29 +02:00
2025-04-14 10:37:46 +02:00
step "${{ inputs.registry_command }} connection to registry" "${{ inputs.registry_server }}..."
2025-04-14 09:07:29 +02:00
2025-04-14 12:35:45 +02:00
if result=$(${{ inputs.registry_command }} login ${{ inputs.registry_server }} \
2025-04-14 10:37:46 +02:00
-u ${{ inputs.registry_user }} \
2025-04-14 12:35:45 +02:00
-p ${{ inputs.registry_password }})
then
2025-04-14 12:43:48 +02:00
success "${result}"
2025-04-14 12:35:45 +02:00
else
error "Error" "${result}"
fi
2025-04-14 08:29:20 +02:00