Skip to content

Commit fd28daf

Browse files
committed
ci: fix main build
1 parent b2ccf84 commit fd28daf

File tree

1 file changed

+30
-12
lines changed

1 file changed

+30
-12
lines changed

.github/workflows/main.yaml

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,6 @@ jobs:
175175
id: meta
176176
with:
177177
images: ${{ steps.registry.outputs.image }}
178-
tags: |
179-
type=raw,value=${{ matrix.elixir }}-${{ matrix.otp }}-${{ matrix.platform[0] }}
180178
- name: define base tag
181179
id: base_tag
182180
run: |
@@ -191,7 +189,6 @@ jobs:
191189
pull: true
192190
no-cache: true
193191
platforms: ${{ matrix.platform[1] }}
194-
tags: ${{ steps.meta.outputs.tags }}
195192
labels: ${{ steps.meta.outputs.labels }}
196193
build-args: |
197194
BUILD_FROM=${{ steps.base_tag.outputs.image }}
@@ -202,26 +199,45 @@ jobs:
202199
outputs: type=image,name=${{ steps.registry.outputs.image }},push-by-digest=true,name-canonical=true,push=true
203200
- name: Export digests
204201
run: |
205-
mkdir -p /tmp/digests-build
202+
mkdir -p /tmp/digests
206203
digest="${{ steps.build.outputs.digest }}"
207-
touch "/tmp/digests-build/${digest#sha256:}"
204+
touch "/tmp/digests/${digest#sha256:}"
208205
- name: Upload digest
209206
uses: actions/upload-artifact@v3
210207
with:
211-
name: digests-build
212-
path: /tmp/digests-build/*
208+
name: "digests-${{ matrix.platform[0] }}-${{ matrix.otp }}-${{ matrix.elixir }}"
209+
path: /tmp/digests/*
213210
if-no-files-found: error
214211
retention-days: 1
215212

216-
merge-build:
213+
merge:
217214
runs-on: ubuntu-latest
218215
needs:
216+
- prepare
219217
- build
220218
strategy:
221219
fail-fast: false
222220
matrix:
223221
base_image_vsn:
224222
- "5.0"
223+
otp: ${{ fromJSON(needs.prepare.outputs.otp) }}
224+
elixir: ${{ fromJSON(needs.prepare.outputs.elixir) }}
225+
platform:
226+
- ubuntu22.04
227+
- ubuntu20.04
228+
- ubuntu18.04
229+
- ubuntu16.04
230+
- debian12
231+
- debian11
232+
- debian10
233+
- debian9
234+
- el9
235+
- el8
236+
- el7
237+
- amzn2
238+
- amzn2023
239+
- alpine3.15.1
240+
225241
steps:
226242
- name: Get ref
227243
id: ref
@@ -233,23 +249,25 @@ jobs:
233249
- name: Download digests
234250
uses: actions/download-artifact@v3
235251
with:
236-
name: digests-build
237-
path: /tmp/digests-build
252+
name: "digests-${{ matrix.platform }}-${{ matrix.otp }}-${{ matrix.elixir }}"
253+
path: /tmp/digests
238254
- name: Set up Docker Buildx
239255
uses: docker/setup-buildx-action@v3
240256
- name: Docker meta
241257
id: meta
242258
uses: docker/metadata-action@v5
243259
with:
244260
images: ${{ steps.registry.outputs.image }}
261+
tags: |
262+
type=raw,value=${{ matrix.elixir }}-${{ matrix.otp }}-${{ matrix.platform }}
245263
- name: Login to Docker Hub
246264
uses: docker/login-action@v3
247265
with:
248266
registry: ghcr.io
249267
username: ${{ github.actor }}
250268
password: ${{ github.token }}
251269
- name: Create manifest list and push
252-
working-directory: /tmp/digests-build
270+
working-directory: /tmp/digests
253271
run: |
254272
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
255273
$(printf '${{ steps.registry.outputs.image }}@sha256:%s ' *)
@@ -259,7 +277,7 @@ jobs:
259277
260278
release:
261279
runs-on: ubuntu-latest
262-
needs: merge-build
280+
needs: merge
263281

264282
if: startsWith(github.ref, 'refs/tags/')
265283

0 commit comments

Comments
 (0)