.github/workflows/deploy.yml- 自动部署工作流.github/workflows/deploy-manual.yml- 手动部署工作流
scripts/deploy-github-pages.sh- Linux/Mac 部署脚本scripts/deploy-github-pages.bat- Windows 部署脚本
.github/ISSUE_TEMPLATE/bug_report.md- Bug 报告模板.github/ISSUE_TEMPLATE/feature_request.md- 功能请求模板.github/pull_request_template.md- PR 模板.github/FUNDING.yml- 赞助配置
static/CNAME- 自定义域名配置DEPLOYMENT.md- 详细部署文档
如果 https://github.com/kaiyuanshe/website 还不存在:
-
创建 GitHub 仓库:
- 前往 https://github.com/orgs/kaiyuanshe/repositories
- 点击 "New repository"
- Repository name:
website - 设置为 Public
- 选择初始化文件
-
推送代码到 GitHub:
# 如果仓库已有初始文件
git clone https://github.com/kaiyuanshe/website.git temp-website
cd temp-website
cp -r /path/to/current/project/* .
cp -r /path/to/current/project/.github .
git add .
git commit -m "feat: 初始化开源社官网 - Docusaurus 重构版"
git push origin main
# 如果是空仓库
git init
git remote add origin https://github.com/kaiyuanshe/website.git
git add .
git commit -m "feat: 初始化开源社官网 - Docusaurus 重构版"
git branch -M main
git push -u origin maingit add .
git commit -m "Update website"
git push origin main- 前往仓库
Settings→Pages - Source 选择
GitHub Actions - 等待自动部署完成
- 修改
static/CNAME文件 - 更新
docusaurus.config.ts中的 URL - 配置 DNS CNAME 记录
// 自定义域名
url: 'https://yourdomain.com',
baseUrl: '/',
// GitHub Pages 子路径
url: 'https://username.github.io',
baseUrl: '/repository-name/',部署成功后访问:
- 自定义域名:
https://yourdomain.com - GitHub 域名:
https://username.github.io/repository-name/
- 检查 Actions 状态: 仓库 → Actions 页面
- 验证 Pages 设置: Settings → Pages
- 确认权限配置: Settings → Actions → General
💡 提示: 首次部署可能需要几分钟时间,请耐心等待!