Skip to content

Commit 2ebdc2a

Browse files
authored
Refactor build workflow to improve file handling
Refactor build process to copy files without rsync and clean up cache.
1 parent 0e829b5 commit 2ebdc2a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/workflows/build-to-branch.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ jobs:
6666
git config user.email "github-actions@github.com"
6767
6868
# 拷贝 .next 但排除 cache
69-
rsync -av --exclude='cache' .next/ /tmp/next-build/
69+
# rsync -av --exclude='cache' .next/ /tmp/next-build/
70+
rm -rf .next/cache
71+
mkdir -p /tmp/next-build
72+
cp -r .next/* /tmp/next-build/
7073
7174
# 切换或创建 build 分支
7275
git checkout -B build
@@ -75,7 +78,10 @@ jobs:
7578
git rm -rf .
7679
7780
# 把 build 产物拷进去(按需修改)
78-
rsync -av /tmp/next-build/ .next/
81+
# rsync -av /tmp/next-build/ .next/
82+
rm -rf .next
83+
mkdir -p .next
84+
cp -r /tmp/next-build/* .next/
7985
8086
git add .next
8187
git commit -m "chore: build from $GITHUB_SHA"

0 commit comments

Comments
 (0)