Skip to content

Commit 9d68371

Browse files
committed
docs: update deploy guide
1 parent f2362af commit 9d68371

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

DEPLOY_GUIDE.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,34 @@
5555

5656
---
5757

58+
## React 前端(当前主站)部署说明
59+
1. **构建并同步课程内容**
60+
```bash
61+
npm run build
62+
```
63+
- 该命令会先执行 `npm run sync-content`,把 `zh/...` 教程与配图复制到 `public/content/...`,再由 Vite 产出 `dist/`
64+
2. **优先使用一键发布**
65+
```bash
66+
npm run deploy
67+
```
68+
- 实际等价于 `gh-pages -d dist`,成功时会自动推送到 `gh-pages` 分支。
69+
3. **遇到 `HTTP 400` 等远端拒绝时的手动方案**
70+
```bash
71+
git worktree add -B gh-pages .gh-pages origin/gh-pages
72+
rm -rf .gh-pages/*
73+
cp -R dist/. .gh-pages/
74+
cd .gh-pages
75+
git add -A
76+
git commit -m "chore: deploy latest build"
77+
git push origin gh-pages
78+
cd ..
79+
git worktree remove .gh-pages
80+
```
81+
- 直接重置 `gh-pages` 分支内容,绕过 `gh-pages` CLI 对大提交或权限的限制。
82+
4. **验证上线**
83+
- 访问 `https://beihaili.github.io/Get-Started-with-Web3/`,或执行 `curl -I` 查看是否返回 `HTTP/2 200`
84+
- GitHub Pages 缓存通常 1~5 分钟,必要时强制刷新浏览器。
85+
86+
---
87+
5888
下次需要自动化部署,只需让AI严格按上述流程操作即可,遇到问题也可直接参考"常见问题与排查"部分。

0 commit comments

Comments
 (0)