@@ -27,27 +27,33 @@ jobs:
2727 sudo apt-get update
2828 sudo apt-get install -y qemu-user-static
2929
30- - name : Build and Push ${{ matrix.target }}
31- env :
32- DOCKER_CLI_EXPERIMENTAL : enabled
30+ - name : Prepare Environment
3331 run : |
3432 # Convert repository name to lowercase
3533 REPO="${{ github.repository }}"
3634 REPO="${REPO,,}"
37- IMAGE_BASE=ghcr.io/$REPO/${{ matrix.target }}
38-
39- # Determine version from tag
40- VERSION=${{ github.ref_name }}
35+ echo "IMAGE_BASE=ghcr.io/$REPO/${{ matrix.target }}" >> $GITHUB_ENV
36+ echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
4137
42- docker build --platform linux/amd64 --target ${{ matrix.target }} -t ${IMAGE_BASE}:${VERSION}-amd64 .
43- docker push ${IMAGE_BASE}:${VERSION}-amd64
38+ - name : Build and Push amd64
39+ env :
40+ DOCKER_CLI_EXPERIMENTAL : enabled
41+ run : |
42+ docker build --platform linux/amd64 --target ${{ matrix.target }} -t ${{ env.IMAGE_BASE }}:${{ env.VERSION }}-amd64 .
43+ docker push ${{ env.IMAGE_BASE }}:${{ env.VERSION }}-amd64
4444
45- docker build --platform linux/arm64 --target ${{ matrix.target }} -t ${IMAGE_BASE}:${VERSION}-arm64 .
46- docker push ${IMAGE_BASE}:${VERSION}-arm64
45+ - name : Build and Push arm64
46+ env :
47+ DOCKER_CLI_EXPERIMENTAL : enabled
48+ run : |
49+ docker build --platform linux/arm64 --target ${{ matrix.target }} -t ${{ env.IMAGE_BASE }}:${{ env.VERSION }}-arm64 .
50+ docker push ${{ env.IMAGE_BASE }}:${{ env.VERSION }}-arm64
4751
48- docker manifest create ${IMAGE_BASE}:${VERSION} \
49- ${IMAGE_BASE}:${VERSION}-amd64 \
50- ${IMAGE_BASE}:${VERSION}-arm64
52+ - name : Create and Push Manifest
53+ env :
54+ DOCKER_CLI_EXPERIMENTAL : enabled
55+ run : |
56+ docker manifest create ${{ env.IMAGE_BASE }}:${{ env.VERSION }} ${{ env.IMAGE_BASE }}:${{ env.VERSION }}-amd64 ${{ env.IMAGE_BASE }}:${{ env.VERSION }}-arm64
5157
52- docker manifest push ${IMAGE_BASE} :${VERSION}
58+ docker manifest push ${{ env. IMAGE_BASE }} :${{ env. VERSION } }
5359
0 commit comments