Skip to content

Commit fbe8509

Browse files
committed
Refactor action.yml and README.md to standardize registry input names, improving clarity and consistency in authentication for multiple registries.
1 parent fc8730b commit fbe8509

File tree

2 files changed

+31
-28
lines changed

2 files changed

+31
-28
lines changed

README.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,15 @@ jobs:
5151
docker-publish:
5252
runs-on: ubuntu-24.04
5353
steps:
54-
- name: docker-build-action
54+
- name: Checkout
55+
uses: actions/checkout@v4
56+
57+
- name: Build and push Docker image
5558
uses: serversideup/github-action-docker-build@v6
5659
with:
5760
tags: serversideup/financial-freedom:latest
5861
registry-username: ${{ secrets.DOCKER_HUB_USERNAME }}
59-
registry-token: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
62+
registry-password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
6063
platforms: "linux/amd64,linux/arm/v7,linux/arm64/v8"
6164
```
6265
@@ -89,17 +92,17 @@ jobs:
8992
# Registry 1: Docker Hub
9093
registry: "docker.io"
9194
registry-username: ${{ secrets.DOCKER_HUB_USERNAME }}
92-
registry-token: ${{ secrets.DOCKER_HUB_TOKEN }}
95+
registry-password: ${{ secrets.DOCKER_HUB_TOKEN }}
9396

9497
# Registry 2: GitHub Container Registry
9598
registry-2: "ghcr.io"
96-
registry-username-2: ${{ github.actor }}
97-
registry-password-2: ${{ secrets.GITHUB_TOKEN }}
99+
registry-2-username: ${{ github.actor }}
100+
registry-2-password: ${{ secrets.GITHUB_TOKEN }}
98101

99102
# Registry 3: Custom Private Registry
100103
registry-3: "registry.example.com"
101-
registry-username-3: ${{ secrets.CUSTOM_REGISTRY_USER }}
102-
registry-password-3: ${{ secrets.CUSTOM_REGISTRY_TOKEN }}
104+
registry-3-username: ${{ secrets.CUSTOM_REGISTRY_USER }}
105+
registry-3-password: ${{ secrets.CUSTOM_REGISTRY_TOKEN }}
103106

104107
platforms: "linux/amd64,linux/arm64"
105108
```
@@ -111,9 +114,9 @@ jobs:
111114
tags|Enter the tag(s) you would like to name your image with. (example: `myorg/myapp:production`) Use multi-line format for multiple tags.|⚠️ Yes|
112115
registry|Choose which container image repository to upload to. <a href="https://github.com/docker/login-action#usage">See all options.</a>| |`docker.io`
113116
registry-username|Enter the username to authenticate with your first registry.|⚠️ Yes|
114-
registry-token (deprecated)| Use `registry-password` instead||
115117
registry-password|Enter the password or token to authenticate with your registry. (an access token is highly recommended)|⚠️ Yes|
116-
context|The relative path to the Dockerfile.| |`.`
118+
registry-token (deprecated)| Use `registry-password` instead||
119+
context|The build context directory (the directory containing your Dockerfile and build files).| |`.`
117120
dockerfile|Filename of the Dockerfile within the context that you set.| |`./Dockerfile`
118121
platforms|Comma separated list of <a href="https://github.com/docker-library/official-images#architectures-other-than-amd64">platforms</a>.| |`linux/amd64`
119122
target|The target build stage to build.| |
@@ -122,11 +125,11 @@ target|The target build stage to build.| |
122125
**🔀 Input Name**|**📚 Description**|**🛑 Required**|**👉 Default**
123126
:-----:|:-----:|:-----:|:-----:
124127
registry-2|Choose which container image repository to upload to. <a href="https://github.com/docker/login-action#usage">See all options.</a>| |
125-
registry-username-2|Enter the username to authenticate with your second registry.|⚠️ Yes (if you use the 2nd registry)|
126-
registry-password-2|Enter the token or password to authenticate with your second registry. (an access token is highly recommended)|⚠️ Yes (if you use the 2nd registry)|
128+
registry-2-username|Enter the username to authenticate with your second registry.|⚠️ Yes (if you use the 2nd registry)|
129+
registry-2-password|Enter the token or password to authenticate with your second registry. (an access token is highly recommended)|⚠️ Yes (if you use the 2nd registry)|
127130
registry-3|Choose which container image repository to upload to. <a href="https://github.com/docker/login-action#usage">See all options.</a>| |
128-
registry-username-3|Enter the username to authenticate with your third registry.|⚠️ Yes (if you use the 3rd registry)|
129-
registry-password-3|Enter the token or password to authenticate with your third registry. (an access token is highly recommended)|⚠️ Yes (if you use the 3rd registry)|
131+
registry-3-username|Enter the username to authenticate with your third registry.|⚠️ Yes (if you use the 3rd registry)|
132+
registry-3-password|Enter the token or password to authenticate with your third registry. (an access token is highly recommended)|⚠️ Yes (if you use the 3rd registry)|
130133

131134
> [!NOTE]
132135
> At least one registry's credentials must be provided (either registry 1, 2, or 3).

action.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,24 @@ inputs:
1717
description: 'Registry to authenticate with (e.g., "docker.io" or "ghcr.io").'
1818
default: 'docker.io' # Default to Docker Hub if not specified
1919
required: false
20-
registry-username-2:
20+
registry-2:
21+
description: 'Registry to authenticate with (e.g., "docker.io" or "ghcr.io").'
22+
registry-2-username:
2123
description: 'Enter the username to authenticate with your registry.'
2224
default: ''
23-
registry-password-2:
25+
registry-2-password:
2426
description: 'Enter the token or password to authenticate with your registry. (an access token is highly recommended)'
2527
default: ''
26-
registry-2:
28+
registry-3:
2729
description: 'Registry to authenticate with (e.g., "docker.io" or "ghcr.io").'
28-
registry-username-3:
30+
registry-3-username:
2931
description: 'Enter the username to authenticate with your registry.'
3032
default: ''
31-
registry-password-3:
33+
registry-3-password:
3234
description: 'Enter the token or password to authenticate with your registry. (an access token is highly recommended)'
3335
default: ''
34-
registry-3:
35-
description: 'Registry to authenticate with (e.g., "docker.io" or "ghcr.io").'
3636
context:
37-
description: 'The relative path to the Dockerfile.'
37+
description: 'The build context directory (the directory containing your Dockerfile and build files).'
3838
default: '.'
3939
required: false
4040
dockerfile:
@@ -53,27 +53,27 @@ runs:
5353
using: 'composite'
5454
steps:
5555

56-
- name: Login to Container Registry ({{ inputs.registry }})
56+
- name: Login to Container Registry
5757
uses: docker/login-action@v3
5858
with:
5959
username: ${{ inputs.registry-username }}
6060
password: ${{ inputs.registry-password || inputs.registry-token }}
6161
registry: ${{ inputs.registry }}
6262

63-
- name: "Login to Container Registry #2 ({{ inputs.registry-2 }})"
63+
- name: "Login to Container Registry #2"
6464
if: inputs.registry-2-username != ''
6565
uses: docker/login-action@v3
6666
with:
67-
username: ${{ inputs.registry-username-2 }}
68-
password: ${{ inputs.registry-password-2 }}
67+
username: ${{ inputs.registry-2-username }}
68+
password: ${{ inputs.registry-2-password }}
6969
registry: ${{ inputs.registry-2 }}
7070

71-
- name: "Login to Container Registry #3 ({{ inputs.registry-3 }})"
71+
- name: "Login to Container Registry #3"
7272
if: inputs.registry-3-username != ''
7373
uses: docker/login-action@v3
7474
with:
75-
username: ${{ inputs.registry-username-3 }}
76-
password: ${{ inputs.registry-password-3 }}
75+
username: ${{ inputs.registry-3-username }}
76+
password: ${{ inputs.registry-3-password }}
7777
registry: ${{ inputs.registry-3 }}
7878

7979
- name: Set up QEMU

0 commit comments

Comments
 (0)