Skip to content

Commit 0fcd867

Browse files
committed
feat: keep things clean
1 parent 8df29b1 commit 0fcd867

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,18 @@ jobs:
3333
BRANCH=$(echo ${GITHUB_REF} | sed -e 's/refs\/heads\///')
3434
TARGET_BRANCH="build/${BRANCH}"
3535
COMMIT_MSG=$(git log -1 --pretty=%B)
36+
37+
if git ls-remote --heads origin ${TARGET_BRANCH} | grep ${TARGET_BRANCH}; then
38+
git push origin --delete
39+
fi
40+
41+
find . -mindepth 1 -maxdepth 1 ! -name 'docs' ! -name '.git' -exec rm -rf {} +
42+
find docs -mindepth 1 -maxdepth 1 ! -name '.vitepress' -exec rm -rf {} +
43+
cp -r docs/.vitepress/docs/* .
44+
rm -rf docs/.vitepress/docs
3645
3746
git checkout -b "${TARGET_BRANCH}"
38-
git add -f docs/.vitepress/dist
47+
git add .
3948
git commit -m "${COMMIT_MSG}"
4049
4150
echo "Branch: ${BRANCH}"

0 commit comments

Comments
 (0)