@@ -7,14 +7,17 @@ inputs:
7
7
description : ' Input string that gets passed along to the docker build args'
8
8
required : true
9
9
tag_list :
10
- description : ' List of tags that gets passed along to the docker build args'
11
- required : true
10
+ description : ' List of comma-separated tags that gets passed along to the docker build args'
11
+ required : false
12
12
default : ' ' # set to an empty string
13
- docker_username :
14
- description : ' Docker username obtained from secrets'
13
+ registry_url :
14
+ description : ' URL of the registry'
15
+ required : true
16
+ registry_user :
17
+ description : ' Username of the registry'
15
18
required : true
16
- docker_password :
17
- description : ' Docker password obtained from secrets '
19
+ registry_pass :
20
+ description : ' Password of the registry '
18
21
required : true
19
22
20
23
runs :
@@ -27,23 +30,29 @@ runs:
27
30
env :
28
31
REPO : ${{ inputs.repo }}
29
32
run : |
30
- docker_repo=${GITHUB_REPOSITORY/opensciencegrid\/docker-/opensciencegrid/}
31
33
if [ -z "${{ inputs.tag_list }}" ]; then
32
- tag_list=$docker_repo:$REPO,$docker_repo:$(date +%Y%m%d-%H%M)
34
+ docker_repo=${GITHUB_REPOSITORY/opensciencegrid\/docker-/opensciencegrid/}
35
+ tag_list=()
36
+ for image_tag in "$REPO" "$REPO-$(date +%Y%m%d-%H%M)"; do
37
+ tag_list+=("${{ inputs.registry_url }}/$docker_repo":"$image_tag")
38
+ done
39
+ IFS=,
40
+ echo "::set-output name=taglist::${tag_list[*]}"
33
41
else
34
- tag_list=${{ inputs.tag_list }}
42
+ tag_list=$(echo ${{ inputs.tag_list }} | sed -E "s/([^,]+)/${{ inputs.registry_url }}\/\1/g")
43
+ echo "::set-output name=taglist::$tag_list"
35
44
fi
36
- echo "::set-output name=taglist::$tag_list"
37
45
shell : bash
38
46
39
47
- name : Set up Docker Buildx
40
48
uses : docker/setup-buildx-action@v1
41
49
42
- - name : Log in to Docker Hub
50
+ - name : Log in to ${{ inputs.registry_url }}
43
51
uses : docker/login-action@v1
44
52
with :
45
- username : ${{ inputs.docker_username }}
46
- password : ${{ inputs.docker_password }}
53
+ registry : ${{ inputs.registry_url }}
54
+ username : ${{ inputs.registry_user }}
55
+ password : ${{ inputs.registry_pass }}
47
56
48
57
- name : Build image
49
58
0 commit comments