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 ee11a65 commit 6f98c41
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/deploy-public.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,21 +89,20 @@ jobs:
git commit -m "Initial public branch from main ${COMMIT_HASH}"
git push origin public
else
# 1. 确保临时目录存在
# 确保临时目录存在
mkdir -p temp_public
# 2. 保存构建产物
# 保存构建产物
cp -r public/* temp_public/
# 3. 切换分支
# 切换分支
git fetch origin public
git checkout -- public
git reset --soft origin/public
git checkout public || git checkout -b public --track origin/public
# 4. 清理当前目录(保留 .git)
# 清理当前目录(保留 .git)
find . -mindepth 1 -maxdepth 1 ! -name '.git' -exec rm -rf {} +
# 5. 恢复构建产物
# 恢复构建产物
cp -r temp_public/* .
rm -rf temp_public
Expand Down

0 comments on commit 6f98c41

Please sign in to comment.