Skip to content

Commit 4132928

Browse files
author
liw003
committed
bb
1 parent 966c0f7 commit 4132928

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

.github/workflows/pages.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,34 @@ jobs:
4747
cache: ${{ steps.detect-package-manager.outputs.manager }}
4848
- run: |
4949
npm ci
50+
- run: |
5051
git log -1 --format=%h > hash.txt
51-
- run: npm run build --if-present
52+
ls -al
53+
npm run build --if-present
54+
55+
56+
57+
- run: |
58+
59+
git config --global user.name "github-actions[bot]"
60+
git config --global user.email "[email protected]"
61+
62+
ls -al
63+
cd www
64+
git init
65+
git add .
66+
git commit -m "Generated files after build"
67+
git checkout -b dist
68+
echo https://github.com/${{ github.repository }}.git
69+
git remote add origin https://github.com/${{ github.repository }}.git
70+
71+
72+
73+
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} HEAD:dist -f # 使用 GITHUB_TOKEN 进行身份验证
74+
env:
75+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # 自动获取 Git
76+
77+
5278

5379

5480

0 commit comments

Comments
 (0)