@@ -2,11 +2,15 @@ name: _Release 5 - Publish Docker Images to Docker Hub
22on :
33 workflow_call :
44 inputs :
5- python :
6- type : boolean
7- required : false
85 base :
96 type : ' string'
7+ image_type :
8+ type : choice
9+ description : The type of image to build
10+ default : ' rust'
11+ options :
12+ - rust
13+ - python
1014
1115permissions :
1216 contents : read
@@ -33,11 +37,10 @@ jobs:
3337 echo "RAPHTORY_VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')" >> $GITHUB_ENV
3438 echo "RUST_VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].rust_version')" >> $GITHUB_ENV
3539
36- - name : Prepare python/rust params
40+ - name : Write dockerfile path
3741 run : |
38- if [ "${{ inputs.python }}" = "true " ]; then
42+ if [ "${{ inputs.image_type }}" = "python " ]; then
3943 echo "DOCKERFILE_PATH=python.Dockerfile" >> $GITHUB_ENV
40- echo "EXTRA_TAG=-python" >> $GITHUB_ENV
4144 else
4245 echo "DOCKERFILE_PATH=Dockerfile" >> $GITHUB_ENV
4346 fi
8386 - name : Upload digest
8487 uses : actions/upload-artifact@v4
8588 with :
86- name : digests-${{ env.PLATFORM_PAIR }}
89+ name : digests-${{ inputs.image_type }}-${{ env.PLATFORM_PAIR }}
8790 path : /tmp/digests/*
8891 if-no-files-found : error
8992 retention-days : 1
97100 uses : actions/download-artifact@v4
98101 with :
99102 path : /tmp/digests
100- pattern : digests-*
103+ pattern : digests-${{ inputs.image_type }}- *
101104 merge-multiple : true
102105
103106 - name : Login to Docker Hub
@@ -122,6 +125,14 @@ jobs:
122125 docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
123126 $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
124127
128+ - name : Write docker tag
129+ run : |
130+ if [ "${{ inputs.image_type }}" = "python" ]; then
131+ echo "DOCKER_TAG=${{ steps.meta.outputs.version }}-python" >> $GITHUB_ENV
132+ else
133+ echo "DOCKER_TAG=${{ steps.meta.outputs.version }}" >> $GITHUB_ENV
134+ fi
135+
125136 - name : Inspect image
126137 run : |
127- docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}${{ env.EXTRA_TAG }}
138+ docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ env.DOCKER_TAG }}
0 commit comments