build(ci): hxtesting 同步代码幂等化,部署目录残留改动自动 stash 留底
deploy-hxtesting / build-and-deploy (push) Failing after 1s

This commit is contained in:
runny committed 2026-11-24 10:28:10 +08:00
1 parent 8bd02e7c7e
commit 7e1e670f0a
1 file changed
+5 -1
+5 -1
View File
@@ -22,9 +22,13 @@ jobs:
set -e
cd "$DEPLOY_DIR"
git fetch origin
git checkout -q -B test origin/test
# 幂等发布:部署目录若残留未提交改动/未跟踪文件(如服务器上临时调试遗留),
# 先整体 stash 留底(-u 含未跟踪文件;不碰 .gitignore 的本地配置),再强制对齐远端
git stash push -u -m "deploy-autostash $(date +%F_%T)" || true
git checkout -f -q -B test origin/test
echo "GIT_SHA=$(git rev-parse --short HEAD)" >> "$GITHUB_ENV"
echo "当前部署提交: $(git log --oneline -1)"
echo "同步后残留脏文件: $(git status --porcelain | wc -l) 项"
- name: 构建镜像(app + frontend,ARM64 原生)
run: |