File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 11name : Build Container Image
22description : Builds the operator container image for the given architecture
33inputs :
4+ get-existing-cache :
5+ description : ' Get cache from the previous build'
6+ required : false
7+ default : ' false'
48 platforms :
59 description : The list of platforms for which the image will be built
610 required : true
6872 with :
6973 go-version-file : " ${{ github.workspace }}/go.mod"
7074 - name : Setup cache
75+ if : ${{ inputs.get-existing-cache == 'false' }}
7176 uses : actions/cache@v3
7277 with :
7378 path : |
Original file line number Diff line number Diff line change 8282 path : |
8383 ./*
8484 key : ${{ github.sha }}
85+ - name : Check go dependencies
86+ id : cache-go
87+ uses : actions/cache@v3
88+ with :
89+ path : |
90+ ~/.cache/go-build
91+ ~/go/pkg/mod
92+ key : ${{ runner.os }}-go-full-${{ hashFiles('**/go.sum') }}
93+ - name : Get go dependencies if cache is missed
94+ if : steps.cache-go.outputs.cache-hit != 'true'
95+ run : |
96+ cd cmd/manager
97+ go get -d
8598 - name : Prepare docker tag
8699 id : prepare-docker-bundle-tag
87100 run : |
92105 - name : Build and Push image
93106 uses : ./.github/actions/build-push-image
94107 with :
108+ get-existing-cache : true
95109 file : bundle.Dockerfile
96110 repository : ${{ env.DOCKER_BUNDLES_REPO }}
97111 version : ${{ steps.prepare.outputs.tag }}
@@ -143,6 +157,13 @@ jobs:
143157 with :
144158 path : ./*
145159 key : ${{ github.sha }}
160+ - name : Get all go dependencies
161+ uses : actions/cache@v3
162+ with :
163+ path : |
164+ ~/.cache/go-build
165+ ~/go/pkg/mod
166+ key : ${{ runner.os }}-go-full-${{ hashFiles('**/go.sum') }}
146167 - name : Prepare tag
147168 id : prepare
148169 uses : ./.github/actions/set-tag
You can’t perform that action at this time.
0 commit comments