diff --git a/.github/workflows/publish_image.yml b/.github/workflows/publish_image.yml index fbb5da8..5f65987 100644 --- a/.github/workflows/publish_image.yml +++ b/.github/workflows/publish_image.yml @@ -36,15 +36,20 @@ jobs: - name: Setup Docker buildx uses: docker/setup-buildx-action@dc7b9719a96d48369863986a06765841d7ea23f6 # v2.0.0 - - name: Prepare metadata + - name: Extract tag prefix + id: extract_tag + run: | + TAG_PREFIX=$(echo "${{ matrix.base-image }}" | sed -E 's/[^:]+:([^@]+)@.*/\1/') + echo "TAG_PREFIX=$TAG_PREFIX" >> $GITHUB_ENV + + - name: Prepare metadata id: meta uses: docker/metadata-action@69f6fc9d46f2f8bf0d5491e4aabe0bb8c6a4678a # v4.0.1 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | - type=sha,enable=true,prefix=git- + type=raw,value=${{ env.TAG_PREFIX }} type=raw,value=latest - type=raw,value=${{ matrix.base-image | replace('/','-') | replace(':','-') | replace('@','-') }} - name: Log into registry ${{ env.REGISTRY }} uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b # v2.0.0