1
+ name : ' Push Container Action'
2
+
3
+ description : ' Push built images to Docker Hub/OSG Harbor'
4
+
5
+ inputs :
6
+ repo :
7
+ description : ' Input string that gets passed along to the docker build args'
8
+ required : true
9
+ tag_list :
10
+ description : ' List of tags that gets passed along to the docker build args'
11
+ required : true
12
+ default : ' ' # set to an empty string
13
+ docker_username :
14
+ description : ' Docker username obtained from secrets'
15
+ required : true
16
+ docker_password :
17
+ description : ' Docker password obtained from secrets'
18
+ required : true
19
+
20
+ runs :
21
+ using : " composite"
22
+ steps :
23
+ - uses : actions/checkout@v2
24
+
25
+ - name : Generate tag list
26
+ id : generate-tag-list
27
+ env :
28
+ REPO : ${{ inputs.repo }}
29
+ run : |
30
+ docker_repo=${GITHUB_REPOSITORY/opensciencegrid\/docker-/opensciencegrid/}
31
+ if [ -z "${{ inputs.tag_list }}" ]; then
32
+ tag_list=$docker_repo:$REPO,$docker_repo:$(date +%Y%m%d-%H%M)
33
+ else
34
+ tag_list=${{ inputs.tag_list }}
35
+ fi
36
+ echo "::set-output name=taglist::$tag_list"
37
+ shell : bash
38
+
39
+ - name : Set up Docker Buildx
40
+ uses : docker/setup-buildx-action@v1
41
+
42
+ - name : Log in to Docker Hub
43
+ uses : docker/login-action@v1
44
+ with :
45
+ username : ${{ inputs.docker_username }}
46
+ password : ${{ inputs.docker_password }}
47
+
48
+ - name : Build image
49
+
50
+ with :
51
+ push : true
52
+ build-args : BASE_YUM_REPO=${{ inputs.repo }}
53
+ tags : " ${{ steps.generate-tag-list.outputs.taglist }}"
54
+ cache-from : type=local,src=/tmp/.buildx-cache
55
+
0 commit comments