Skip to content

Commit 18f2b70

Browse files
committed
Upgrade 'Docker images test' workflow
1 parent 8df985f commit 18f2b70

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

.github/workflows/test-docker.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ name: Docker images test
33
on:
44
workflow_dispatch:
55
inputs:
6+
distribution_code:
7+
description: |
8+
Specific code to identify the new distribution. The distribution package will be named with the following nomenclature: `test-{{distribution_code}}-{{sha}}`
9+
required: true
10+
type: string
611
commit_sha:
712
description: |
813
SHA of the commit on which the mithril binaries should be obtained, a "ci.yml" workflow must have run
@@ -26,15 +31,19 @@ jobs:
2631
strategy:
2732
fail-fast: false
2833
matrix:
29-
project: [ mithril-aggregator, mithril-client-cli, mithril-signer ]
34+
project: [ mithril-aggregator, mithril-client-cli, mithril-signer, mithril-relay ]
35+
36+
include:
37+
- project: mithril-client-cli
38+
package: mithril-client
3039

3140
permissions:
3241
contents: read
3342
packages: write
3443

3544
env:
3645
REGISTRY: ghcr.io
37-
IMAGE_NAME: ${{ github.repository_owner }}/${{ matrix.project }}
46+
PACKAGE: ${{ github.repository_owner }}/${{ matrix.package != '' && matrix.package || matrix.project }}
3847
DOCKER_FILE: ./${{ matrix.project }}/Dockerfile.ci
3948
CONTEXT: .
4049
GITHUB_REF: ${{ github.ref}}
@@ -43,6 +52,10 @@ jobs:
4352
- name: Checkout repository
4453
uses: actions/checkout@v3
4554

55+
- name: Get short SHA
56+
id: slug
57+
run: echo "sha8=$(echo ${{ inputs.commit_sha }} | cut -c1-7)" >> $GITHUB_OUTPUT
58+
4659
- name: Checkout commit
4760
run: |
4861
git checkout ${{ inputs.commit_sha }}
@@ -67,10 +80,10 @@ jobs:
6780
id: meta
6881
uses: docker/metadata-action@v4
6982
with:
70-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
83+
images: ${{ env.REGISTRY }}/${{ env.PACKAGE }}
7184
tags: |
7285
test
73-
type=raw,value=test-${{ inputs.commit_sha }}
86+
type=raw,value=test-${{ inputs.distribution_code }}-${{ steps.slug.outputs.sha8 }}
7487
7588
- name: Build and push Docker image
7689
uses: docker/build-push-action@v3

0 commit comments

Comments
 (0)