@@ -22,12 +22,33 @@ inputs:
22
22
registry_pass :
23
23
description : ' Password of the registry'
24
24
required : true
25
+ context :
26
+ description : ' Path to container files, including Dockerfile'
27
+ required : false
28
+ default : ' .'
25
29
26
30
runs :
27
31
using : " composite"
28
32
steps :
29
33
- uses : actions/checkout@v2
30
34
35
+ - id : generate-image-name
36
+ shell : bash
37
+ run : |
38
+ if [[ ${{ inputs.context }} == "." ]] || \
39
+ [[ ${{ inputs.context }} == "./" ]]; then
40
+ # Try to guess the image name from our docker repo naming conventions
41
+ # E.g., opensciencegrid/docker-frontier-squid
42
+ IMAGE_NAME=${GITHUB_REPOSITORY/opensciencegrid\/docker-//}
43
+ elif [[ -d ${{ inputs.context }} ]]; then
44
+ # Assume that the containing dir is the image name
45
+ IMAGE_NAME=$(basename ${{ inputs.context }})
46
+ else
47
+ echo "${{ inputs.context }} is not a directory"
48
+ exit 1
49
+ fi
50
+ echo "::set-output name=image::$IMAGE_NAME"
51
+
31
52
- name : Generate tag list
32
53
id : generate-tag-list
33
54
env :
52
73
uses : actions/cache@v2
53
74
with :
54
75
path : /tmp/.buildx-cache
55
- key : ${{ inputs.osg_series}}- ${{ inputs.repo }}-buildx- ${{ github.sha }}- ${{ github.run_id }}
76
+ key : ${{ steps.generate-image-name.outputs.image }}_${{ inputs.osg_series}}_ ${{ inputs.repo }}_buildx_ ${{ github.sha }}_ ${{ github.run_id }}
56
77
57
78
- name : Set up Docker Buildx
58
79
uses : docker/setup-buildx-action@v1
68
89
69
90
with :
70
91
push : true
92
+ context : ${{ inputs.context }}
71
93
build-args : |
72
94
BASE_YUM_REPO=${{ inputs.repo }}
73
95
BASE_OSG_SERIES=${{ inputs.osg_series }}
0 commit comments