@@ -14,17 +14,11 @@ jobs:
14
14
runs-on : ubuntu-latest
15
15
steps :
16
16
- name : Checkout code
17
- uses : actions/checkout@v2
17
+ uses : actions/checkout@v4
18
18
- name : Set up Go
19
- uses : actions/setup-go@v1
19
+ uses : actions/setup-go@v4
20
20
with :
21
- go-version : 1.20.6
22
- - uses : actions/cache@v2
23
- with :
24
- path : ~/go/pkg/mod
25
- key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
26
- restore-keys : |
27
- ${{ runner.os }}-go
21
+ go-version : 1.20.11
28
22
- name : Get dependencies
29
23
run : curl -L --fail "https://github.com/apple/foundationdb/releases/download/${FDB_VER}/foundationdb-clients_${FDB_VER}-1_amd64.deb" -o fdb.deb
30
24
- name : Install dependencies
@@ -41,22 +35,16 @@ jobs:
41
35
# See https://kubernetes.io/releases for the current releases
42
36
kubever : [ "v1.21.1", "v1.22.0", "v1.23.0" ]
43
37
steps :
44
- - name : Set up Go
45
- uses : actions/setup-go@v1
46
- with :
47
- go-version : 1.20.6
48
38
- name : Check out code into the Go module directory
49
- uses : actions/checkout@v2
39
+ uses : actions/checkout@v4
50
40
with :
51
41
fetch-depth : 0
42
+ - name : Set up Go
43
+ uses : actions/setup-go@v4
44
+ with :
45
+ go-version : 1.20.11
52
46
- name : Fetch all tags
53
47
run : git fetch --force --tags
54
- - uses : actions/cache@v2
55
- with :
56
- path : ~/go/pkg/mod
57
- key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
58
- restore-keys : |
59
- ${{ runner.os }}-go
60
48
- name : Get dependencies
61
49
env :
62
50
KIND_VER : " v0.11.1"
@@ -108,22 +96,16 @@ jobs:
108
96
name : Testing
109
97
runs-on : ubuntu-latest
110
98
steps :
111
- - name : Set up Go
112
- uses : actions/setup-go@v1
113
- with :
114
- go-version : 1.20.6
115
99
- name : Check out code into the Go module directory
116
- uses : actions/checkout@v2
100
+ uses : actions/checkout@v4
117
101
with :
118
102
fetch-depth : 0
103
+ - name : Set up Go
104
+ uses : actions/setup-go@v4
105
+ with :
106
+ go-version : 1.20.11
119
107
- name : Fetch all tags
120
108
run : git fetch --force --tags
121
- - uses : actions/cache@v2
122
- with :
123
- path : ~/go/pkg/mod
124
- key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
125
- restore-keys : |
126
- ${{ runner.os }}-go
127
109
- name : Get dependencies
128
110
run : |
129
111
# Only download all dependencies
@@ -145,47 +127,43 @@ jobs:
145
127
image :
146
128
- fdb-kubernetes-operator
147
129
- fdb-data-loader
148
- - fdb-kubernetes-operator-distroless
149
130
include :
150
131
- image : fdb-kubernetes-operator
151
132
context : ./
152
133
name : foundationdb/fdb-kubernetes-operator
153
- tagSuffix : " "
154
- file : ./Dockerfile
155
- baseImage : " docker.io/debian:bullseye"
156
- - image : fdb-kubernetes-operator-distroless
157
- context : ./
158
- name : foundationdb/fdb-kubernetes-operator
159
- tagSuffix : -distrolesss
160
134
file : ./Dockerfile
161
- baseImage : " gcr.io/distroless/base"
162
135
- image : fdb-data-loader
163
136
context : ./sample-apps/data-loader
164
137
name : foundationdb/fdb-data-loader
165
- tagSuffix : " "
166
138
file : ./sample-apps/data-loader/Dockerfile
167
- baseImage : " "
168
139
steps :
169
140
- name : Check out the repo
170
- uses : actions/checkout@v2
141
+ uses : actions/checkout@v4
171
142
- name : Set up Docker Buildx
172
- uses : docker/setup-buildx-action@v1
143
+ uses : docker/setup-buildx-action@v3
173
144
- name : Login to DockerHub
174
145
if : github.ref == 'refs/heads/main'
175
- uses : docker/login-action@v1
146
+ uses : docker/login-action@v3
176
147
with :
177
148
username : ${{ secrets.DOCKERHUB_USERNAME }}
178
149
password : ${{ secrets.DOCKERHUB_TOKEN }}
179
- - name : Get the sha
180
- id : get_sha
181
- run : echo ::set-output name=TAG::${GITHUB_SHA}
182
150
- name : Build image
183
- uses : docker/build-push-action@v2
151
+ uses : docker/build-push-action@v5
184
152
with :
185
153
build-args : |
186
- TAG=${{ steps.get_sha.outputs.TAG }}
187
- BASE_IMAGE=${{ matrix.baseImage }}
154
+ TAG=${{ github.sha }}
188
155
push : ${{ github.ref == 'refs/heads/main' }}
189
156
context : ${{ matrix.context }}
190
- tags : ${{ matrix.name }}:latest${{ matrix.tagSuffix }}
157
+ tags : ${{ matrix.name }}:latest
191
158
file : ${{ matrix.file }}
159
+ - name : Run Trivy vulnerability scanner
160
+ if : ${{ matrix.image }} == 'fdb-kubernetes-operator'
161
+ uses : aquasecurity/trivy-action@master
162
+ with :
163
+ image-ref : ' docker.io/foundationdb/fdb-kubernetes-operator:latest'
164
+ format : ' table'
165
+ exit-code : ' 1'
166
+ ignore-unfixed : true
167
+ vuln-type : ' os,library'
168
+ severity : ' CRITICAL,HIGH'
169
+
0 commit comments