7
7
type : string
8
8
description : Docker image tag name (Optional)
9
9
10
+ env :
11
+ IBIS_IMAGE : ghcr.io/canner/wren-engine-ibis
12
+
10
13
jobs :
11
14
prepare-tag :
12
15
runs-on : ubuntu-latest
@@ -69,16 +72,26 @@ jobs:
69
72
build-args : |
70
73
WREN_VERSION=${{ steps.prepare.outputs.WREN_VERSION }}
71
74
push : true
72
- build-ibis-amd64- image :
75
+ build-ibis-image :
73
76
needs : prepare-tag
74
77
runs-on : ubuntu-latest
78
+ strategy :
79
+ fail-fast : false
80
+ matrix :
81
+ platform :
82
+ - linux/amd64
83
+ - linux/arm64
75
84
steps :
85
+ - name : Prepare platform
86
+ run : |
87
+ platform=${{ matrix.platform }}
88
+ echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
76
89
- uses : actions/checkout@v4
77
90
- name : Docker meta
78
91
id : meta
79
92
uses : docker/metadata-action@v5
80
93
with :
81
- images : ghcr.io/canner/wren-engine-ibis
94
+ images : ${{ env.IBIS_IMAGE }}
82
95
tags : |
83
96
type=raw,value=${{ needs.prepare-tag.outputs.tag_name }}
84
97
- name : Login to GitHub Container Registry
@@ -91,45 +104,57 @@ jobs:
91
104
uses : docker/setup-qemu-action@v3
92
105
- name : Set up Docker Buildx
93
106
uses : docker/setup-buildx-action@v3
94
- - name : Build and push
95
- uses : docker/build-push-action@v5
107
+ - name : Build and push by digest
108
+ id : build
109
+ uses : docker/build-push-action@v6
96
110
with :
111
+ platforms : ${{ matrix.platform }}
97
112
context : ./ibis-server
98
113
build-contexts : |
99
114
wren-core-py=./wren-core-py
100
115
wren-core=./wren-core
101
- platforms : linux/amd64
102
- push : true
103
116
tags : ${{ steps.meta.outputs.tags }}
104
- build-ibis-arm64-image :
105
- needs : prepare-tag
117
+ outputs : type=image,name=${{ env.IBIS_IMAGE }},push-by-digest=true,name-canonical=true,push=true
118
+ - name : Export digest
119
+ run : |
120
+ mkdir -p /tmp/digests
121
+ digest="${{ steps.build.outputs.digest }}"
122
+ touch "/tmp/digests/${digest#sha256:}"
123
+ - name : Upload digest
124
+ uses : actions/upload-artifact@v4
125
+ with :
126
+ name : digests-${{ env.PLATFORM_PAIR }}
127
+ path : /tmp/digests/*
128
+ if-no-files-found : error
129
+ retention-days : 1
130
+ merge :
106
131
runs-on : ubuntu-latest
132
+ needs : build-ibis-image
107
133
steps :
108
- - uses : actions/checkout@v4
134
+ - name : Download digests
135
+ uses : actions/download-artifact@v4
136
+ with :
137
+ path : /tmp/digests
138
+ pattern : digests-*
139
+ merge-multiple : true
140
+ - name : Set up Docker Buildx
141
+ uses : docker/setup-buildx-action@v3
109
142
- name : Docker meta
110
143
id : meta
111
144
uses : docker/metadata-action@v5
112
145
with :
113
- images : ghcr.io/canner/wren-engine-ibis
114
- tags : |
115
- type=raw,value=${{ needs.prepare-tag.outputs.tag_name }}
146
+ images : ${{ env.IBIS_IMAGE }}
116
147
- name : Login to GitHub Container Registry
117
148
uses : docker/login-action@v3
118
149
with :
119
150
registry : ghcr.io
120
151
username : ${{ github.actor }}
121
152
password : ${{ secrets.GITHUB_TOKEN }}
122
- - name : Set up QEMU
123
- uses : docker/setup-qemu-action@v3
124
- - name : Set up Docker Buildx
125
- uses : docker/setup-buildx-action@v3
126
- - name : Build and push
127
- uses : docker/build-push-action@v5
128
- with :
129
- context : ./ibis-server
130
- build-contexts : |
131
- wren-core-py=./wren-core-py
132
- wren-core=./wren-core
133
- platforms : linux/arm64
134
- push : true
135
- tags : ${{ steps.meta.outputs.tags }}
153
+ - name : Create manifest list and push
154
+ working-directory : /tmp/digests
155
+ run : |
156
+ docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
157
+ $(printf '${{ env.IBIS_IMAGE }}@sha256:%s ' *)
158
+ - name : Inspect image
159
+ run : |
160
+ docker buildx imagetools inspect ${{ env.IBIS_IMAGE }}:${{ steps.meta.outputs.version }}
0 commit comments