feat: 更新Docker镜像构建流程,确保使用默认标签并优化标签处理逻辑

This commit is contained in:
infinitycat
2025-05-10 02:00:59 +08:00
parent 4fc33278c9
commit f96fffe16e

View File

@@ -136,8 +136,16 @@ jobs:
- name: Create manifest list and push - name: Create manifest list and push
working-directory: ${{ runner.temp }}/digests working-directory: ${{ runner.temp }}/digests
run: | run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "${{ needs.prepare.outputs.tags }}") \ # 确保至少有一个默认标签
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) TAGS="-t ${{ env.REGISTRY_IMAGE }}:latest"
# 如果 meta 输出的标签不为空,则使用它们
if [ -n "${{ needs.prepare.outputs.tags }}" ]; then
TAGS=$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "${{ needs.prepare.outputs.tags }}")
fi
echo "Using tags: ${TAGS}"
docker buildx imagetools create ${TAGS} $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
- name: Inspect image - name: Inspect image
run: | run: |