@@ -12,29 +12,36 @@ jobs:
12
12
runs-on : ubuntu-latest
13
13
14
14
steps :
15
- - name : ' Checkout'
16
- uses : actions/checkout@v3
15
+ - name : " Checkout"
16
+ uses : actions/checkout@v4
17
17
18
- - name : ' Setup buildx'
19
- uses : docker/setup-buildx-action@v2
18
+ - name : " Setup buildx"
19
+ uses : docker/setup-buildx-action@v3
20
20
with :
21
21
install : true
22
22
23
- - name : ' Docker login'
24
- uses : docker/login-action@v2
23
+ - name : " Docker login docker.io "
24
+ uses : docker/login-action@v3
25
25
with :
26
26
username : kbstci
27
27
password : ${{ secrets.DOCKER_AUTH }}
28
28
29
- - name : ' Build artifacts'
29
+ - name : " Docker login ghcr.io"
30
+ uses : docker/login-action@v3
31
+ with :
32
+ registry : ghcr.io
33
+ username : ${{ github.actor }}
34
+ password : ${{ secrets.GITHUB_TOKEN }}
35
+
36
+ - name : " Build artifacts"
30
37
env :
31
38
DOCKER_PUSH : true
32
39
GIT_SHA : ${{ github.sha }}
33
40
GIT_REF : ${{ github.ref }}
34
41
run : make dist
35
42
36
- - name : ' Upload artifacts'
37
- uses : actions/upload-artifact@v3
43
+ - name : " Upload artifacts"
44
+ uses : actions/upload-artifact@v4
38
45
with :
39
46
name : test-artifacts
40
47
path : ./quickstart/_dist
@@ -44,95 +51,109 @@ jobs:
44
51
needs : [build-test-artifacts]
45
52
strategy :
46
53
matrix :
47
- starter : ["multi-cloud", "aks", "eks", "gke" , "kind"]
54
+ starter : ["multi-cloud", "aks", "eks", "gke", "kind"]
48
55
49
56
permissions :
50
57
id-token : write # needed for keyless signing
51
58
52
59
steps :
53
- - name : ' Free disk space'
60
+ - name : " Free disk space"
54
61
# https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
55
62
run : |
56
63
sudo rm -rf /usr/share/dotnet
57
64
sudo rm -rf /opt/ghc
58
65
sudo rm -rf /usr/local/share/boost
59
66
sudo rm -rf $AGENT_TOOLSDIRECTORY
60
67
61
- - name : ' Checkout'
62
- uses : actions/checkout@v3
68
+ - name : " Checkout"
69
+ uses : actions/checkout@v4
63
70
64
- - name : ' Download test-artifacts'
65
- uses : actions/download-artifact@v3
71
+ - name : " Download test-artifacts"
72
+ uses : actions/download-artifact@v4
66
73
with :
67
74
name : test-artifacts
68
75
path : ./quickstart/_dist
69
76
70
77
- name : Install Cosign
71
- uses : sigstore/cosign-installer@9614fae9e5c5eddabb09f90a270fcb487c9f7149 # v3.3 .0
78
+ uses : sigstore/cosign-installer@9614fae9e5c5eddabb09f90a270fcb487c9f7149 # v3.7 .0
72
79
73
- - name : ' Setup buildx'
74
- uses : docker/setup-buildx-action@v2
80
+ - name : " Setup buildx"
81
+ uses : docker/setup-buildx-action@v3
75
82
with :
76
83
install : true
77
84
78
- - name : ' Docker login'
79
- uses : docker/login-action@v2
85
+ - name : " Docker login docker.io "
86
+ uses : docker/login-action@v3
80
87
with :
81
88
username : kbstci
82
89
password : ${{ secrets.DOCKER_AUTH }}
83
90
91
+ - name : " Docker login ghcr.io"
92
+ uses : docker/login-action@v3
93
+ with :
94
+ registry : ghcr.io
95
+ username : ${{ github.actor }}
96
+ password : ${{ secrets.GITHUB_TOKEN }}
97
+
84
98
- name : Build ${{ matrix.starter }} image
85
99
env :
86
100
DOCKER_PUSH : true
87
101
DOCKER_TARGET : ${{ matrix.starter }}
88
102
run : make build
89
103
90
- - name : ' Sign Images'
104
+ - name : " Sign Images"
91
105
env :
92
106
COSIGN_EXPERIMENTAL : true
93
107
run : |
94
- cosign sign --yes -a GIT_HASH=${{ github.sha }} -a GIT_REF=${{ github.ref }} kubestack/framework- dev:test-${{ github.sha }}-${{ matrix.starter }}
108
+ cosign sign --yes -a GIT_HASH=${{ github.sha }} -a GIT_REF=${{ github.ref }} ghcr.io/kbst/terraform-kubestack/ dev:test-${{ github.sha }}-${{ matrix.starter }}
95
109
96
110
test :
97
111
runs-on : ubuntu-latest
98
112
needs : [build-test-artifacts, build-image]
99
113
strategy :
100
114
fail-fast : false
101
115
matrix :
102
- starter : ["multi-cloud", "aks", "eks", "gke" , "kind"]
116
+ starter : ["multi-cloud", "aks", "eks", "gke", "kind"]
103
117
104
118
steps :
105
- - name : ' Download test-artifacts'
106
- uses : actions/download-artifact@v3
119
+ - name : " Download test-artifacts"
120
+ uses : actions/download-artifact@v4
107
121
with :
108
122
name : test-artifacts
109
123
path : ./quickstart/_dist
110
124
111
- - name : ' Unzip ${{ matrix.starter }} quickstart'
125
+ - name : " Unzip ${{ matrix.starter }} quickstart"
112
126
run : |
113
127
unzip quickstart/_dist/kubestack-starter-${{ matrix.starter }}-*.zip
114
128
115
- - name : ' Docker login'
116
- uses : docker/login-action@v2
129
+ - name : " Docker login docker.io "
130
+ uses : docker/login-action@v3
117
131
with :
118
132
username : kbstci
119
133
password : ${{ secrets.DOCKER_AUTH }}
120
134
121
- - name : ' Docker build'
135
+ - name : " Docker login ghcr.io"
136
+ uses : docker/login-action@v3
137
+ with :
138
+ registry : ghcr.io
139
+ username : ${{ github.actor }}
140
+ password : ${{ secrets.GITHUB_TOKEN }}
141
+
142
+ - name : " Docker build"
122
143
env :
123
144
DOCKER_BUILDKIT : 1
124
145
working-directory : ./kubestack-starter-${{ matrix.starter }}
125
146
# retagging here is necessary because we only push images
126
147
# to kubestack/framework after they have been tested
127
148
# but the Dockerfiles in the artifact have the target image name
128
149
run : |
129
- SOURCE_IMAGE=kubestack/framework- dev:test-${{ github.sha }}-${{ matrix.starter }}
150
+ SOURCE_IMAGE=ghcr.io/kbst/terraform-kubestack/ dev:test-${{ github.sha }}-${{ matrix.starter }}
130
151
docker pull $SOURCE_IMAGE
131
152
TARGET_IMAGE=$(cat Dockerfile | sed 's/FROM //')
132
153
docker tag $SOURCE_IMAGE $TARGET_IMAGE
133
154
docker build -t test-image:${{ github.sha }} .
134
155
135
- - name : ' Configure Kubestack for ${{ matrix.starter }}'
156
+ - name : " Configure Kubestack for ${{ matrix.starter }}"
136
157
working-directory : ./kubestack-starter-${{ matrix.starter }}
137
158
run : |
138
159
# ALL: set name_prefix
@@ -159,31 +180,31 @@ jobs:
159
180
# GKE: set cluster_node_locations
160
181
sed -i 's/cluster_node_locations = ""/cluster_node_locations = "europe-west1-b,europe-west1-c,europe-west1-d"/g' gke_zero_cluster.tf || true
161
182
162
- - name : ' Terraform init'
183
+ - name : " Terraform init"
163
184
working-directory : ./kubestack-starter-${{ matrix.starter }}
164
185
run : |
165
186
docker run --rm \
166
187
-v `pwd`:/infra \
167
188
test-image:${{ github.sha }} \
168
189
terraform init
169
190
170
- - name : ' Terraform workspace new ops'
191
+ - name : " Terraform workspace new ops"
171
192
working-directory : ./kubestack-starter-${{ matrix.starter }}
172
193
run : |
173
194
docker run --rm \
174
195
-v `pwd`:/infra \
175
196
test-image:${{ github.sha }} \
176
197
terraform workspace new ops
177
198
178
- - name : ' Terraform validate'
199
+ - name : " Terraform validate"
179
200
working-directory : ./kubestack-starter-${{ matrix.starter }}
180
201
run : |
181
202
docker run --rm \
182
203
-v `pwd`:/infra \
183
204
test-image:${{ github.sha }} \
184
205
terraform validate
185
206
186
- - name : ' Terraform plan'
207
+ - name : " Terraform plan"
187
208
working-directory : ./kubestack-starter-${{ matrix.starter }}
188
209
env :
189
210
KBST_AUTH_AWS : ${{ secrets.KBST_AUTH_AWS }}
@@ -203,34 +224,40 @@ jobs:
203
224
runs-on : ubuntu-latest
204
225
needs : [test]
205
226
206
-
207
227
strategy :
208
228
matrix :
209
- starter : ["multi-cloud", "aks", "eks", "gke" , "kind"]
229
+ starter : ["multi-cloud", "aks", "eks", "gke", "kind"]
210
230
211
231
steps :
212
- - name : ' Download test-artifacts'
213
- uses : actions/download-artifact@v3
232
+ - name : " Download test-artifacts"
233
+ uses : actions/download-artifact@v4
214
234
with :
215
235
name : test-artifacts
216
236
path : ./quickstart/_dist
217
237
218
238
- name : Install Cosign
219
- uses : sigstore/cosign-installer@9614fae9e5c5eddabb09f90a270fcb487c9f7149 # v3.3 .0
239
+ uses : sigstore/cosign-installer@9614fae9e5c5eddabb09f90a270fcb487c9f7149 # v3.7 .0
220
240
221
- - name : ' Docker login'
222
- uses : docker/login-action@v2
241
+ - name : " Docker login docker.io "
242
+ uses : docker/login-action@v3
223
243
with :
224
244
username : kbstci
225
245
password : ${{ secrets.DOCKER_AUTH }}
226
246
227
- - name : ' Docker push'
247
+ - name : " Docker login ghcr.io"
248
+ uses : docker/login-action@v3
249
+ with :
250
+ registry : ghcr.io
251
+ username : ${{ github.actor }}
252
+ password : ${{ secrets.GITHUB_TOKEN }}
253
+
254
+ - name : " Docker push"
228
255
# cosign copy copies the images and the signature from one place to another
229
256
# then we dont need to sign again the same image
230
257
env :
231
258
COSIGN_EXPERIMENTAL : true
232
259
run : |
233
- SOURCE_IMAGE=kubestack/framework- dev:test-${{ github.sha }}-${{ matrix.starter }}
260
+ SOURCE_IMAGE=ghcr.io/kbst/terraform-kubestack/ dev:test-${{ github.sha }}-${{ matrix.starter }}
234
261
TARGET_IMAGE=$(cat quickstart/_dist/kubestack-starter-${{ matrix.starter }}/Dockerfile | sed 's/FROM //')
235
262
echo "Source image $SOURCE_IMAGE will be pushed to $TARGET_IMAGE"
236
263
cosign copy $SOURCE_IMAGE $TARGET_IMAGE
@@ -246,27 +273,27 @@ jobs:
246
273
247
274
strategy :
248
275
matrix :
249
- starter : ["multi-cloud", "aks", "eks", "gke" , "kind"]
276
+ starter : ["multi-cloud", "aks", "eks", "gke", "kind"]
250
277
251
278
steps :
252
- - name : ' Download test-artifacts'
253
- uses : actions/download-artifact@v3
279
+ - name : " Download test-artifacts"
280
+ uses : actions/download-artifact@v4
254
281
with :
255
282
name : test-artifacts
256
283
path : ./quickstart/_dist
257
284
258
285
- name : Install Cosign
259
- uses : sigstore/cosign-installer@9614fae9e5c5eddabb09f90a270fcb487c9f7149 # v3.3 .0
286
+ uses : sigstore/cosign-installer@9614fae9e5c5eddabb09f90a270fcb487c9f7149 # v3.7 .0
260
287
261
- - id : ' auth'
262
- uses : ' google-github-actions/auth@v1 '
288
+ - id : " auth"
289
+ uses : google-github-actions/auth@v2
263
290
with :
264
291
credentials_json : ${{ secrets.GCLOUD_AUTH }}
265
292
266
- - name : ' Setup gcloud'
267
- uses : google-github-actions/setup-gcloud@v1
293
+ - name : " Setup gcloud"
294
+ uses : google-github-actions/setup-gcloud@v2
268
295
269
- - name : ' Publish ${{ matrix.starter }} starter'
296
+ - name : " Publish ${{ matrix.starter }} starter"
270
297
env :
271
298
COSIGN_EXPERIMENTAL : true
272
299
run : |
0 commit comments