File tree 3 files changed +25
-5
lines changed 3 files changed +25
-5
lines changed Original file line number Diff line number Diff line change 8
8
description : ' The name of the artifact to upload'
9
9
required : true
10
10
type : string
11
+ platform :
12
+ description : ' The platform to build the image for'
13
+ required : true
14
+ type : string
11
15
12
16
permissions :
13
17
contents : read
@@ -45,21 +49,23 @@ jobs:
45
49
run : |
46
50
git lfs install
47
51
git lfs pull
48
- - name : Test build on arm64 and amd64
52
+ - name : Test build - ${{ inputs.platform }}
49
53
id : docker_build
50
54
uses : docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v5
51
55
with :
52
56
context : .
53
57
file : ./Dockerfile
54
- platforms : linux/amd64,linux/arm64
58
+ platforms : ${{ inputs.platform }}
55
59
push : false # Only attempt to build, to verify the Dockerfile is working
56
- # load: true
60
+ load : true
57
61
cache-from : type=gha
58
62
cache-to : type=gha,mode=max
59
63
build-args : |
60
64
LATEST_RELEASE=${{ env.LATEST_RELEASE }}
61
65
tags : ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
62
66
- name : Save Docker image as a tarball
67
+ # Only save the image if the build was for linux/amd64, as we only need it for the integration tests
68
+ if : ${{ inputs.platform == 'linux/amd64' }}
63
69
run : |
64
70
# List all images
65
71
docker images
Original file line number Diff line number Diff line change @@ -14,10 +14,17 @@ jobs:
14
14
name : Build, Test & Lint
15
15
uses : ./.github/workflows/ci.yml
16
16
image-build :
17
- name : OCI Image - Build
17
+ name : OCI Image - Build x86
18
18
uses : ./.github/workflows/image-build.yml
19
19
with :
20
20
artifact-name : " codegate-image"
21
+ platform : " linux/amd64"
22
+ image-build-arm64 :
23
+ name : OCI Image - Build ARM64
24
+ uses : ./.github/workflows/image-build.yml
25
+ with :
26
+ artifact-name : " codegate-image"
27
+ platform : " linux/arm64"
21
28
integration-tests :
22
29
if : github.event.pull_request.head.repo.full_name == 'stacklok/codegate'
23
30
name : Integration Tests
Original file line number Diff line number Diff line change @@ -14,10 +14,17 @@ jobs:
14
14
name : Build, Test & Lint
15
15
uses : ./.github/workflows/ci.yml
16
16
image-build :
17
- name : OCI Image - Build
17
+ name : OCI Image - Build x86
18
18
uses : ./.github/workflows/image-build.yml
19
19
with :
20
20
artifact-name : " codegate-image"
21
+ platform : " linux/amd64"
22
+ image-build-arm64 :
23
+ name : OCI Image - Build ARM64
24
+ uses : ./.github/workflows/image-build.yml
25
+ with :
26
+ artifact-name : " codegate-image"
27
+ platform : " linux/arm64"
21
28
integration-tests :
22
29
name : Integration Tests
23
30
needs : [ci, image-build] # We need the image available in order to run the integration tests
You can’t perform that action at this time.
0 commit comments