File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 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严格按上述流程操作即可,遇到问题也可直接参考"常见问题与排查"部分。
You can’t perform that action at this time.
0 commit comments