update
This commit is contained in:
@@ -114,14 +114,8 @@ jobs:
|
||||
echo "====== 开始构建 Docker 镜像 ======"
|
||||
echo "构建时间: $(date '+%Y-%m-%d %H:%M:%S')"
|
||||
echo "分支: ${{ github.ref_name }}"
|
||||
echo "提交: ${{ github.sha }}"
|
||||
|
||||
if [ -n "${{ github.event.head_commit.message }}" ]; then
|
||||
echo "提交信息: ${{ github.event.head_commit.message }}"
|
||||
echo "提交者: ${{ github.event.head_commit.author.name }}"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
echo "====== 构建配置 ======"
|
||||
echo "镜像: ${{ steps.prepare.outputs.full_image }}"
|
||||
echo "Dockerfile: ${{ inputs.dockerfile }}"
|
||||
@@ -168,37 +162,9 @@ jobs:
|
||||
echo ""
|
||||
echo "✓ 镜像验证成功"
|
||||
|
||||
- name: Show image details
|
||||
run: |
|
||||
echo "====== 镜像详细信息 ======"
|
||||
docker images --format "table {{.Repository}}\t{{.Tag}}\t{{.Size}}\t{{.CreatedAt}}" | grep "${{ inputs.image_name }}" || true
|
||||
echo ""
|
||||
|
||||
echo "====== 镜像层信息(前10层)======"
|
||||
docker history "${{ steps.prepare.outputs.full_image }}" --format "table {{.CreatedBy}}\t{{.Size}}" | head -11
|
||||
|
||||
- name: Cleanup
|
||||
if: always()
|
||||
run: |
|
||||
echo "====== 清理悬空镜像 ======"
|
||||
docker image prune -f
|
||||
echo "✓ 清理完成"
|
||||
|
||||
- name: Build summary
|
||||
if: always()
|
||||
run: |
|
||||
echo "====== 构建摘要 ======"
|
||||
echo "镜像名称: ${{ steps.prepare.outputs.full_image }}"
|
||||
echo "Dockerfile: ${{ inputs.dockerfile }}"
|
||||
echo "构建上下文: ${{ inputs.context }}"
|
||||
echo "分支: ${{ github.ref_name }}"
|
||||
echo "提交: ${{ github.sha }}"
|
||||
echo "触发方式: ${{ github.event_name }}"
|
||||
echo "构建状态: ${{ job.status }}"
|
||||
echo ""
|
||||
|
||||
if [ "${{ job.status }}" == "success" ]; then
|
||||
echo "🎉 镜像构建成功!"
|
||||
else
|
||||
echo "❌ 镜像构建失败,请检查日志"
|
||||
fi
|
||||
Reference in New Issue
Block a user