Skip to content

Commit 0e829b5

Browse files
authored
Refactor build process with rsync for efficiency
1 parent 2f5b025 commit 0e829b5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ jobs:
6666
git config user.email "github-actions@github.com"
6767
6868
# 拷贝 .next 但排除 cache
69-
# rsync -av --exclude='cache' .next/ /tmp/next-build
70-
rm -rf .next/cache
71-
cp -r .next /tmp/next-build
69+
rsync -av --exclude='cache' .next/ /tmp/next-build/
7270
7371
# 切换或创建 build 分支
7472
git checkout -B build
@@ -77,7 +75,7 @@ jobs:
7775
git rm -rf .
7876
7977
# 把 build 产物拷进去(按需修改)
80-
cp -r /tmp/next-build .next
78+
rsync -av /tmp/next-build/ .next/
8179
8280
git add .next
8381
git commit -m "chore: build from $GITHUB_SHA"

0 commit comments

Comments
 (0)