Skip to content

Commit fa9f6d1

Browse files
committed
Added registry support
1 parent a29f0a8 commit fa9f6d1

File tree

2 files changed

+31
-13
lines changed

2 files changed

+31
-13
lines changed

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,25 +48,26 @@ jobs:
4848
docker-publish:
4949
runs-on: ubuntu-22.04
5050
steps:
51-
- name: Login to DockerHub
52-
uses: docker/login-action@v2
53-
with:
54-
username: ${{ secrets.DOCKER_HUB_USERNAME }}
55-
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
56-
5751
- name: docker-build-action
58-
uses: serversideup/github-action-docker-build@v1.0.0
52+
uses: serversideup/github-action-docker-build@v1
5953
with:
6054
tags: serversideup/financial-freedom:latest
55+
registry-username: ${{ secrets.DOCKER_HUB_USERNAME }}
56+
registry-token: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
6157
platforms: "linux/amd64,linux/arm/v7,linux/arm64/v8"
62-
context: "./docker/"
6358
```
6459
### Configuration options
65-
**🔀 Variable Name**|**📚 Description**|**👉 Default**
66-
:-----:|:-----:|:-----:
67-
tags|Enter the tag you would like to name your image with. (example: `myorg/myapp:production`)|(🚨 Required to be set)
68-
context|The relative path to the Dockerfile.|`.`
69-
platforms|Comma separated list of <a href="https://github.com/docker-library/official-images#architectures-other-than-amd64">platforms</a>.|`linux/amd64`
60+
**🔀 Input Name**|**📚 Description**|**🛑 Required**|**👉 Default**
61+
:-----:|:-----:|:-----:|:-----:
62+
tags|Enter the tag you would like to name your image with. (example: `myorg/myapp:production`)|⚠️ Yes|
63+
registry-username|Enter the username to authenticate with your registry.|⚠️ Yes|
64+
registry-token|Enter the token or password to authenticate with your registry. (an access token is highly recommended)|⚠️ Yes|
65+
registry|Choose which container image repository to upload to. <a href="https://github.com/docker/login-action#usage">See all options.</a>| |Docker Hub
66+
context|The relative path to the Dockerfile.| |`.`
67+
platforms|Comma separated list of <a href="https://github.com/docker-library/official-images#architectures-other-than-amd64">platforms</a>.| |`linux/amd64`
68+
69+
### Important security notice
70+
Always use encrypted secrets when passing sensitive information. [Learn more here →](https://docs.github.com/en/actions/security-guides/encrypted-secrets)
7071

7172
### Security Disclosures
7273
If you find a security vulnerability, please let us know as soon as possible.

action.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ inputs:
44
tags:
55
description: 'Enter the tag you would like to name your image with. (example: myorg/myapp:production)'
66
required: true
7+
registry-username:
8+
description: 'Enter the username to authenticate with your registry.'
9+
required: true
10+
registry-token:
11+
description: 'Enter the token or password to authenticate with your registry. (an access token is highly recommended)'
12+
required: true
13+
registry:
14+
description: 'Choose which container image repository to upload to.'
15+
default: '' # Defaults to Docker Hub
16+
required: false
717
context:
818
description: 'The relative path to the Dockerfile.'
919
default: '.'
@@ -15,6 +25,13 @@ inputs:
1525
runs:
1626
using: 'composite'
1727
steps:
28+
- name: Login to Container Image Registry
29+
uses: docker/login-action@v2
30+
with:
31+
username: ${{ inputs.registry-username }}
32+
password: ${{ inputs.registry-password }}
33+
registry: ${{ inputs.registry }}
34+
1835
- name: Get branch name
1936
id: branch-name
2037
uses: tj-actions/branch-names@v6

0 commit comments

Comments
 (0)