Skip to content

Commit 86a44be

Browse files
authored
Expanded support for multiple registries
1 parent 264be04 commit 86a44be

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

action.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ inputs:
66
required: true
77
registry-username:
88
description: 'Enter the username to authenticate with your registry.'
9+
default: "${{ github.actor }}"
910
required: true
1011
registry-token:
1112
description: 'Enter the token or password to authenticate with your registry. (an access token is highly recommended)'
13+
default: "${{ secrets.GITHUB_TOKEN }}"
1214
required: true
1315
registry:
14-
description: 'Choose which container image repository to upload to.'
15-
default: '' # Defaults to Docker Hub
16+
description: 'Comma-separated list of container registries to authenticate with (e.g., "docker.io,ghcr.io").'
17+
default: 'docker.io' # Default to Docker Hub if not specified
1618
required: false
1719
context:
1820
description: 'The relative path to the Dockerfile.'
@@ -34,12 +36,21 @@ runs:
3436
using: 'composite'
3537
steps:
3638

37-
- name: Login to Container Image Registry
39+
- name: Login to Docker Hub
40+
if: contains(inputs.registry, 'docker.io')
3841
uses: docker/login-action@v3
3942
with:
4043
username: ${{ inputs.registry-username }}
4144
password: ${{ inputs.registry-token }}
42-
registry: ${{ inputs.registry }}
45+
registry: docker.io
46+
47+
- name: Login to GitHub Container Registry
48+
if: contains(inputs.registry, 'ghcr.io')
49+
uses: docker/login-action@v3
50+
with:
51+
username: ${{ inputs.registry-username }}
52+
password: ${{ inputs.registry-token }}
53+
registry: ghcr.io
4354

4455
- name: Set up QEMU
4556
uses: docker/setup-qemu-action@v3

0 commit comments

Comments
 (0)