Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
zzzhizhia committed Jan 5, 2025
1 parent 9aae131 commit 6ef5641
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/deploy-public.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,22 @@ jobs:
git commit -m "Initial public branch from main ${COMMIT_HASH}"
git push origin public
else
# 保存构建产物到临时目录
mv public temp_public
# 1. 确保临时目录存在
mkdir -p temp_public
# 更新现有 public 分支
# 2. 保存构建产物
cp -r public/* temp_public/
# 3. 切换分支
git fetch origin public
git checkout public
git reset --soft origin/public
# 清理并复制文件
rm -rf ./*
mv temp_public/* .
# 4. 清理当前目录(保留 .git)
find . -mindepth 1 -maxdepth 1 ! -name '.git' -exec rm -rf {} +
# 5. 恢复构建产物
cp -r temp_public/* .
rm -rf temp_public
git add .
Expand Down

0 comments on commit 6ef5641

Please sign in to comment.