File tree Expand file tree Collapse file tree 1 file changed +34
-7
lines changed Expand file tree Collapse file tree 1 file changed +34
-7
lines changed Original file line number Diff line number Diff line change 3
3
name : Build and Push
4
4
5
5
on :
6
- pull_request :
7
- types :
8
- - closed
6
+ push :
7
+ branches :
8
+ - ' main'
9
+ paths :
10
+ - ' config/manager/params.env'
9
11
workflow_dispatch :
10
12
13
+ env :
14
+ IMAGE_FOUND : ' false'
15
+
11
16
jobs :
17
+ check-image-existence :
18
+ name : Build and push ODH/CFO image
19
+ runs-on : ubuntu-latest
20
+ steps :
21
+ - uses : actions/checkout@v4
22
+
23
+ - name : Set Go
24
+ uses : actions/setup-go@v5
25
+ with :
26
+ go-version-file : ' ./go.mod'
27
+
28
+ - name : Verify that the latest images are available on Quay
29
+ run : |
30
+ imageTag=$(cat config/manager/params.env | grep codeflare-operator-controller-image | cut -d ':' -f2)
31
+ size=$(curl -s https://quay.io/api/v1/repository/project-codeflare/codeflare-operator/tag/?specificTag=$imageTag | jq .tags[0].size)
32
+ if [[ "$size" -ne 0 ]]; then
33
+ echo "Operator image with tag $imageTag found in Quay.io, skipping image build"
34
+ echo "IMAGE_FOUND=true" >> "$GITHUB_ENV"
35
+ fi
36
+
12
37
build-and-push :
13
- if : (github.event.pull_request.merged == true && github.event.pull_request.user.login == 'codeflare-machine-account' && contains(github.event.pull_request.title, 'Sync with Upstream')) || github.event_name == 'workflow_dispatch'
38
+ needs : [check-image-existence]
39
+ if : ${{ env.IMAGE_FOUND == 'true' }}
40
+
14
41
name : Build and push ODH/CFO image
15
42
runs-on : ubuntu-latest
16
43
steps :
17
- - uses : actions/checkout@v3
44
+ - uses : actions/checkout@v4
18
45
19
46
- name : Set Go
20
- uses : actions/setup-go@v3
47
+ uses : actions/setup-go@v5
21
48
with :
22
- go-version : v1.20
49
+ go-version-file : ' ./go.mod '
23
50
24
51
- name : Login to Quay.io
25
52
uses : redhat-actions/podman-login@v1
You can’t perform that action at this time.
0 commit comments