Files
registry-login/action.yaml

56 lines
1.7 KiB
YAML
Raw Normal View History

2025-04-14 08:41:32 +02:00
name: 'Connect to a docker registry'
2025-04-14 09:05:27 +02:00
description: 'Connection to a docker registry using podman or docker'
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
default: 'podman'
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 10:37:46 +02:00
- 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
2025-04-14 08:41:32 +02:00
- name: Podman connection to the registry
2025-04-14 08:29:20 +02:00
shell: bash
run: |
2025-04-14 10:37:46 +02:00
source "${{ github.action_path }}/bashlib.sh"
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 10:37:46 +02:00
result=$(${{ inputs.registry_command }} login ${{ inputs.registry_server }} \
-u ${{ inputs.registry_user }} \
-p ${{ inputs.registry_password }}) \
&& success "${result}" \
|| error "Error" "${result}"
2025-04-14 09:05:27 +02:00
2025-04-14 08:29:20 +02:00