1
- name : dispatched build-docker-image
1
+ name : Build container images
2
2
3
3
on :
4
4
push :
19
19
id : mkdatetag
20
20
run : echo "::set-output name=dtag::$(date +%Y%m%d-%H%M)"
21
21
22
- build :
22
+ base-image- build :
23
23
runs-on : ubuntu-latest
24
- needs : [make-date-tag]
25
24
if : startsWith(github.repository, 'opensciencegrid/')
26
25
strategy :
27
26
fail-fast : False
@@ -41,41 +40,65 @@ jobs:
41
40
- id : generate-tag-list
42
41
env :
43
42
REPO : ${{ matrix.repo }}
44
- TIMESTAMP : ${{ needs.make-date-tag.outputs.dtag }}
45
43
run : |
46
44
docker_repo=${GITHUB_REPOSITORY/opensciencegrid\/docker-/opensciencegrid/}
47
- tag_list=$docker_repo:$REPO,$docker_repo:$REPO-$TIMESTAMP
48
- echo "::set-output name=taglist::$tag_list"
45
+ echo "::set-output name=taglist::$docker_repo:$REPO"
49
46
50
47
- name : Set up Docker Buildx
51
48
uses : docker/setup-buildx-action@v1
52
49
53
- - name : Log in to Docker Hub
54
- uses : docker/login-action@v1
55
- with :
56
- username : ${{ secrets.DOCKER_USERNAME }}
57
- password : ${{ secrets.DOCKER_PASSWORD }}
58
-
59
50
- name : Build and push Docker images
60
51
61
52
with :
62
53
build-args : BASE_YUM_REPO=${{ matrix.repo }}
63
54
tags : " ${{ steps.generate-tag-list.outputs.taglist }}"
55
+ context : base
64
56
cache-to : type=local,dest=/tmp/.buildx-cache
65
57
66
- dispatch :
58
+ child-image-builds :
67
59
runs-on : ubuntu-latest
60
+ needs : [make-date-tag, base-image-build]
68
61
if : startsWith(github.repository, 'opensciencegrid/')
69
- needs : build
70
62
strategy :
63
+ fail-fast : False
71
64
matrix :
72
- dispatch- repo :
73
- - docker- osg-ce-condor
65
+ repo : ['development', 'testing', 'release']
66
+ image : ['hosted-ce', ' osg-ce-condor']
74
67
steps :
75
68
76
- - name : dispatch build ${{ matrix.dispatch-repo }}
77
- uses : peter-evans/repository-dispatch@v1
69
+ - name : checkout compute-entrypoint
70
+ uses : actions/checkout@v2
71
+
72
+ - name : Load cached base image
73
+ uses : actions/cache@v2
74
+ with :
75
+ path : /tmp/.buildx-cache
76
+ key : base-${{ matrix.repo }}-buildx-${{ github.sha }}
77
+
78
+ - id : generate-tag-list
79
+ env :
80
+ REPO : ${{ matrix.repo }}
81
+ IMAGE : ${{ matrix.image }}
82
+ TIMESTAMP : ${{ needs.make-date-tag.outputs.dtag }}
83
+ run : |
84
+ docker_repo=opensciencegrid/$IMAGE
85
+ tag_list=$docker_repo:$REPO,$docker_repo:$REPO-$TIMESTAMP
86
+ echo "::set-output name=taglist::$tag_list"
87
+
88
+ - name : Set up Docker Buildx
89
+ uses : docker/setup-buildx-action@v1
90
+
91
+ - name : Log in to Docker Hub
92
+ uses : docker/login-action@v1
93
+ with :
94
+ username : ${{ secrets.DOCKER_USERNAME }}
95
+ password : ${{ secrets.DOCKER_PASSWORD }}
96
+
97
+ - name : Build and push Docker images
98
+
78
99
with :
79
- token : ${{ secrets.REPO_ACCESS_TOKEN }}
80
- repository : opensciencegrid/${{ matrix.dispatch-repo }}
81
- event-type : dispatch-build
100
+ push : True
101
+ build-args : BASE_YUM_REPO=${{ matrix.repo }}
102
+ tags : " ${{ steps.generate-tag-list.outputs.taglist }}"
103
+ context : ${{ matrix.image }}
104
+ cache-from : type=local,dest=/tmp/.buildx-cache
0 commit comments