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,18 +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
82
- tags : |
83
- type=raw,value=${{ needs.prepare-tag.outputs.tag_name }}
94
+ images : ${{ env.IBIS_IMAGE }}
84
95
- name : Login to GitHub Container Registry
85
96
uses : docker/login-action@v3
86
97
with :
@@ -91,26 +102,46 @@ jobs:
91
102
uses : docker/setup-qemu-action@v3
92
103
- name : Set up Docker Buildx
93
104
uses : docker/setup-buildx-action@v3
94
- - name : Build and push
95
- uses : docker/build-push-action@v5
105
+ - name : Build and push by digest
106
+ id : build
107
+ uses : docker/build-push-action@v6
96
108
with :
109
+ platforms : ${{ matrix.platform }}
110
+ labels : ${{ steps.meta.outputs.labels }}
97
111
context : ./ibis-server
98
112
build-contexts : |
99
113
wren-core-py=./wren-core-py
100
114
wren-core=./wren-core
101
- platforms : linux/amd64
102
- push : true
103
- tags : ${{ steps.meta.outputs.tags }}
104
- build-ibis-arm64-image :
105
- needs : prepare-tag
115
+ outputs : type=image,name=${{ env.IBIS_IMAGE }},push-by-digest=true,name-canonical=true,push=true
116
+ - name : Export digest
117
+ run : |
118
+ mkdir -p /tmp/digests
119
+ digest="${{ steps.build.outputs.digest }}"
120
+ touch "/tmp/digests/${digest#sha256:}"
121
+ - name : Upload digest
122
+ uses : actions/upload-artifact@v4
123
+ with :
124
+ name : digests-${{ env.PLATFORM_PAIR }}
125
+ path : /tmp/digests/*
126
+ if-no-files-found : error
127
+ retention-days : 1
128
+ merge :
106
129
runs-on : ubuntu-latest
130
+ needs : build-ibis-image
107
131
steps :
108
- - uses : actions/checkout@v4
132
+ - name : Download digests
133
+ uses : actions/download-artifact@v4
134
+ with :
135
+ path : /tmp/digests
136
+ pattern : digests-*
137
+ merge-multiple : true
138
+ - name : Set up Docker Buildx
139
+ uses : docker/setup-buildx-action@v3
109
140
- name : Docker meta
110
141
id : meta
111
142
uses : docker/metadata-action@v5
112
143
with :
113
- images : ghcr.io/canner/wren-engine-ibis
144
+ images : ${{ env.IBIS_IMAGE }}
114
145
tags : |
115
146
type=raw,value=${{ needs.prepare-tag.outputs.tag_name }}
116
147
- name : Login to GitHub Container Registry
@@ -119,17 +150,12 @@ jobs:
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
+ --tag ${{ env.IBIS_IMAGE }}:${{ steps.meta.outputs.tags }}
159
+ - name : Inspect image
160
+ run : |
161
+ docker buildx imagetools inspect ${{ env.IBIS_IMAGE }}:${{ steps.meta.outputs.tags }}
0 commit comments