Update deploy.yml

This commit is contained in:
Vaica committed 2026-06-25 15:53:43 +08:00
1 parent 1d55a17d00
commit d73c30cdb1
1 file changed
+21 -19
+21 -19
View File
@@ -553,7 +553,7 @@ jobs:
if [ "$EDGEONE_DEPLOYED" = "true" ]; then if [ "$EDGEONE_DEPLOYED" = "true" ]; then
EDGEONE_DOWNLOAD="${{ needs.deploy-edgeone.outputs.download_duration }}" EDGEONE_DOWNLOAD="${{ needs.deploy-edgeone.outputs.download_duration }}"
EDGEONE_UPLOAD="${{ needs.deploy-edgeone.outputs.upload_duration }}" EDGEONE_UPLOAD="${{ needs.deploy-edgeone.outputs.upload_duration }}"
EDGEONE_DETAIL="\n - 下载: ${EDGEONE_DOWNLOAD}s\n - 上传: ${EDGEONE_UPLOAD}s" EDGEONE_DETAIL=$'\n - 下载: '"${EDGEONE_DOWNLOAD}"'s\n - 上传: '"${EDGEONE_UPLOAD}"'s'
else else
EDGEONE_DETAIL="" EDGEONE_DETAIL=""
fi fi
@@ -561,7 +561,7 @@ jobs:
if [ "$UPYUN_DEPLOYED" = "true" ]; then if [ "$UPYUN_DEPLOYED" = "true" ]; then
UPYUN_DOWNLOAD="${{ needs.deploy-upyun.outputs.download_duration }}" UPYUN_DOWNLOAD="${{ needs.deploy-upyun.outputs.download_duration }}"
UPYUN_UPLOAD="${{ needs.deploy-upyun.outputs.upload_duration }}" UPYUN_UPLOAD="${{ needs.deploy-upyun.outputs.upload_duration }}"
UPYUN_DETAIL="\n - 下载: ${UPYUN_DOWNLOAD}s\n - 上传: ${UPYUN_UPLOAD}s" UPYUN_DETAIL=$'\n - 下载: '"${UPYUN_DOWNLOAD}"'s\n - 上传: '"${UPYUN_UPLOAD}"'s'
else else
UPYUN_DETAIL="" UPYUN_DETAIL=""
fi fi
@@ -572,16 +572,17 @@ jobs:
TITLE="ℹ️ **无变化,跳过部署**" TITLE="ℹ️ **无变化,跳过部署**"
fi fi
MESSAGE="${TITLE} CURRENT_TIME=$(date +'%Y-%m-%d %H:%M:%S')
MESSAGE="$TITLE
📦 项目: ${{ github.repository }} 📦 项目: ${{ github.repository }}
🌿 分支: ${{ github.ref_name }} 🌿 分支: ${{ github.ref_name }}
🔗 Commit: ${{ github.sha }} 🔗 Commit: ${{ github.sha }}
🕐 时间: $(date +'%Y-%m-%d %H:%M:%S') 🕐 时间: $CURRENT_TIME
📊 构建统计: 📊 构建统计:
- 文件总数: ${FILE_COUNT} - 文件总数: $FILE_COUNT
- 总大小: ${TOTAL_SIZE} - 总大小: $TOTAL_SIZE
⏱️ 耗时统计: ⏱️ 耗时统计:
- Pre-check: ${PRECHECK_DUR}s - Pre-check: ${PRECHECK_DUR}s
@@ -637,7 +638,7 @@ jobs:
fi fi
CURRENT_TIME=$(date +'%Y-%m-%d %H:%M:%S') CURRENT_TIME=$(date +'%Y-%m-%d %H:%M:%S')
MESSAGE_TEXT="${TITLE}\n\n📦 项目: ${{ github.repository }}\n🌿 分支: ${{ github.ref_name }}\n🔗 Commit: ${{ github.sha }}\n🕐 时间: ${CURRENT_TIME}\n\n📊 构建统计:\n- 文件总数: ${FILE_COUNT}\n- 总大小: ${TOTAL_SIZE}\n\n⏱️ 耗时统计:\n- Pre-check: ${PRECHECK_DUR}s\n- Build: ${BUILD_DUR}s\n- EdgeOne: ${EDGEONE_DUR}s${EDGEONE_DETAIL}\n- UpYun: ${UPYUN_DUR}s${UPYUN_DETAIL}\n\n🔍 查看详情: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" MESSAGE_TEXT="$TITLE"$'\n\n'"📦 项目: ${{ github.repository }}"$'\n'"🌿 分支: ${{ github.ref_name }}"$'\n'"🔗 Commit: ${{ github.sha }}"$'\n'"🕐 时间: ${CURRENT_TIME}"$'\n\n'"📊 构建统计:"$'\n'"- 文件总数: ${FILE_COUNT}"$'\n'"- 总大小: ${TOTAL_SIZE}"$'\n\n'"⏱️ 耗时统计:"$'\n'"- Pre-check: ${PRECHECK_DUR}s"$'\n'"- Build: ${BUILD_DUR}s"$'\n'"- EdgeOne: ${EDGEONE_DUR}s${EDGEONE_DETAIL}"$'\n'"- UpYun: ${UPYUN_DUR}s${UPYUN_DETAIL}"$'\n\n'"🔍 查看详情: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
curl -s -X POST "${FEISHU_WEBHOOK_URL}" \ curl -s -X POST "${FEISHU_WEBHOOK_URL}" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
@@ -789,18 +790,19 @@ jobs:
fi fi
FAILURES="" FAILURES=""
if [ "${{ needs.pre-check.result }}" = "failure" ]; then FAILURES="${FAILURES}\n- ❌ Pre-check"; fi if [ "${{ needs.pre-check.result }}" = "failure" ]; then FAILURES="${FAILURES}"$'\n'"- ❌ Pre-check"; fi
if [ "${{ needs.build.result }}" = "failure" ]; then FAILURES="${FAILURES}\n- ❌ Build"; fi if [ "${{ needs.build.result }}" = "failure" ]; then FAILURES="${FAILURES}"$'\n'"- ❌ Build"; fi
if [ "${{ needs.deploy-edgeone.result }}" = "failure" ]; then FAILURES="${FAILURES}\n- ❌ Deploy EdgeOne"; fi if [ "${{ needs.deploy-edgeone.result }}" = "failure" ]; then FAILURES="${FAILURES}"$'\n'"- ❌ Deploy EdgeOne"; fi
if [ "${{ needs.deploy-upyun.result }}" = "failure" ]; then FAILURES="${FAILURES}\n- ❌ Deploy UpYun"; fi if [ "${{ needs.deploy-upyun.result }}" = "failure" ]; then FAILURES="${FAILURES}"$'\n'"- ❌ Deploy UpYun"; fi
if [ "${{ needs.finalize.result }}" = "failure" ]; then FAILURES="${FAILURES}\n- ❌ Finalize"; fi if [ "${{ needs.finalize.result }}" = "failure" ]; then FAILURES="${FAILURES}"$'\n'"- ❌ Finalize"; fi
CURRENT_TIME=$(date +'%Y-%m-%d %H:%M:%S')
MESSAGE="❌ **部署失败** MESSAGE="❌ **部署失败**
📦 项目: ${{ github.repository }} 📦 项目: ${{ github.repository }}
🌿 分支: ${{ github.ref_name }} 🌿 分支: ${{ github.ref_name }}
🔗 Commit: ${{ github.sha }} 🔗 Commit: ${{ github.sha }}
🕐 时间: $(date +'%Y-%m-%d %H:%M:%S') 🕐 时间: $CURRENT_TIME
⚠️ 失败阶段:$FAILURES ⚠️ 失败阶段:$FAILURES
@@ -821,14 +823,14 @@ jobs:
fi fi
FAILURES="" FAILURES=""
if [ "${{ needs.pre-check.result }}" = "failure" ]; then FAILURES="${FAILURES}\n- ❌ Pre-check"; fi if [ "${{ needs.pre-check.result }}" = "failure" ]; then FAILURES="${FAILURES}"$'\n'"- ❌ Pre-check"; fi
if [ "${{ needs.build.result }}" = "failure" ]; then FAILURES="${FAILURES}\n- ❌ Build"; fi if [ "${{ needs.build.result }}" = "failure" ]; then FAILURES="${FAILURES}"$'\n'"- ❌ Build"; fi
if [ "${{ needs.deploy-edgeone.result }}" = "failure" ]; then FAILURES="${FAILURES}\n- ❌ Deploy EdgeOne"; fi if [ "${{ needs.deploy-edgeone.result }}" = "failure" ]; then FAILURES="${FAILURES}"$'\n'"- ❌ Deploy EdgeOne"; fi
if [ "${{ needs.deploy-upyun.result }}" = "failure" ]; then FAILURES="${FAILURES}\n- ❌ Deploy UpYun"; fi if [ "${{ needs.deploy-upyun.result }}" = "failure" ]; then FAILURES="${FAILURES}"$'\n'"- ❌ Deploy UpYun"; fi
if [ "${{ needs.finalize.result }}" = "failure" ]; then FAILURES="${FAILURES}\n- ❌ Finalize"; fi if [ "${{ needs.finalize.result }}" = "failure" ]; then FAILURES="${FAILURES}"$'\n'"- ❌ Finalize"; fi
CURRENT_TIME=$(date +'%Y-%m-%d %H:%M:%S') CURRENT_TIME=$(date +'%Y-%m-%d %H:%M:%S')
MESSAGE_TEXT="❌ **部署失败**\n\n📦 项目: ${{ github.repository }}\n🌿 分支: ${{ github.ref_name }}\n🔗 Commit: ${{ github.sha }}\n🕐 时间: ${CURRENT_TIME}\n\n⚠️ 失败阶段:${FAILURES}\n\n🔍 查看详情: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" MESSAGE_TEXT="❌ **部署失败**"$'\n\n'"📦 项目: ${{ github.repository }}"$'\n'"🌿 分支: ${{ github.ref_name }}"$'\n'"🔗 Commit: ${{ github.sha }}"$'\n'"🕐 时间: ${CURRENT_TIME}"$'\n\n'"⚠️ 失败阶段:${FAILURES}"$'\n\n'"🔍 查看详情: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
curl -s -X POST "${FEISHU_WEBHOOK_URL}" \ curl -s -X POST "${FEISHU_WEBHOOK_URL}" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \