Files
registry-login/action.yaml
2025-04-14 10:37:46 +02:00

56 lines
1.7 KiB
YAML

name: 'Connect to a docker registry'
description: 'Connection to a docker registry using podman or docker'
author: 'Eric Coissac'
inputs:
registry_command:
description: 'command used to realise the login'
required: false
default: 'podman'
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: 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: Podman 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 }}..."
result=$(${{ inputs.registry_command }} login ${{ inputs.registry_server }} \
-u ${{ inputs.registry_user }} \
-p ${{ inputs.registry_password }}) \
&& success "${result}" \
|| error "Error" "${result}"