Skip to content

Commit cd0c157

Browse files
committed
feat: new push logic
1 parent 73cb2a5 commit cd0c157

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,22 @@ jobs:
2626
run: 'yarn run docs:build'
2727

2828
- name: Push to Publish Branch
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }
2931
run: |
3032
git config --global user.name 'github-actions[bot]'
3133
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
3234
3335
BRANCH=$(echo ${GITHUB_REF} | sed -e 's/refs\/heads\///')
3436
TARGET_BRANCH="build/${BRANCH}"
3537
COMMIT_MSG=$(git log -1 --pretty=%B)
36-
ORIGIN_URL=$(git config --get remote.origin.url)
37-
38-
git subtree push --prefix=docs/.vitepress/dist origin ${TARGET_BRANCH}
38+
39+
git checkout -b "${TARGET_BRANCH}"
40+
git add -f docs/.vitepress/dist
41+
git commit -m "${COMMIT_MSG}"
3942
4043
echo "Branch: ${BRANCH}"
4144
echo "Pushing to ${TARGET_BRANCH}"
42-
echo "Origin URL: ${ORIGIN_URL}"
43-
echo "Commit Message: ${COMMIT_MSG}"
45+
echo "Commit Message: ${COMMIT_MSG}"
46+
47+
git push origin "${TARGET_BRANCH}"

0 commit comments

Comments
 (0)