Files
registry-login/action.yaml
2025-12-26 15:12:31 +01:00

68 lines
2.0 KiB
YAML

name: 'Connect to a docker registry'
description: 'Connection to a docker registry using podman, docker or skopeo'
author: 'Eric Coissac'
inputs:
registry_command:
description: 'command used to realise the login'
required: false
default: 'skopeo'
registry_server:
description: 'Address of the image registry server'
required: false
default: "niepce.petite-maison-orange.fr"
registry_user:
description: 'User used for the connection to the image registry'
required: false
default: ${{ secrets.PMO_REGISTRY_USER }}
registry_password:
description: 'Password used for the connection to the image registry'
required: false
default: ${{ secrets.PMO_REGISTRY_PASSWORD }}
debug:
description: 'Run the action in debug mode'
required: false
default: false
type: boolean
runs:
using: 'composite'
steps:
- name: Load bash library
uses: https://gargoton.petite-maison-orange.fr/pmo-actions/bash-library@main
- name: Set debug mode
if: inputs.debug == 'true'
shell: bash
run: |
source "${{ github.action_path }}/../bashlib.sh"
export DEBUG="ON"
echo "DEBUG=ON" >> $GITEA_ENV
debug Debug switch on
- 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 }}
- name: Connection to the registry
shell: bash
run: |
source "${{ github.action_path }}/../bashlib.sh"
check_command ${{ inputs.registry_command }}
step "${{ inputs.registry_command }} connection to registry" "${{ inputs.registry_server }}..."
if result=$(${{ inputs.registry_command }} login ${{ inputs.registry_server }} \
-u ${{ inputs.registry_user }} \
-p ${{ inputs.registry_password }})
then
success "${result}"
else
error "Error" "${result}"
fi