Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Deploy Documentation to GitHub Pages

on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r docs/requirements.txt

- name: Build multilingual documentation
run: |
cd docs
python build_multilang.py

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: docs/build/html

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
149 changes: 149 additions & 0 deletions DEPLOYMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
# GitHub Pages 部署指南

本文档说明如何将 Xorbits Inference Enterprise 文档部署到 GitHub Pages。

## 🚀 自动部署

### 前置条件

1. **GitHub 仓库设置**
- 确保仓库是公开的(或者有 GitHub Pro/Team 账户用于私有仓库)
- 在仓库设置中启用 GitHub Pages

2. **GitHub Pages 配置**
- 进入仓库 Settings → Pages
- Source 选择 "GitHub Actions"
- 保存设置

### 部署流程

当你推送代码到 `main` 或 `master` 分支时,GitHub Actions 会自动:

1. **安装依赖**: 安装 Python 和 Sphinx 相关包
2. **构建文档**: 运行 `build_multilang.py` 生成多语言文档
3. **部署到 Pages**: 将构建结果发布到 GitHub Pages

### 访问地址

部署完成后,文档将在以下地址可用:

- **中文文档**: `https://[username].github.io/[repository-name]/`
- **英文文档**: `https://[username].github.io/[repository-name]/en/`

例如:
- 中文: https://xorbitsai.github.io/enterprise-docs/
- 英文: https://xorbitsai.github.io/enterprise-docs/en/

## 🔧 手动部署

如果需要手动部署,可以按以下步骤操作:

### 1. 本地构建

```bash
cd docs
python build_multilang.py
```

### 2. 推送到 gh-pages 分支

```bash
# 安装 ghp-import(如果还没有安装)
pip install ghp-import

# 推送到 gh-pages 分支
ghp-import -n -p -f docs/build/html
```

## 📁 文件结构

```
enterprise-docs/
├── .github/
│ └── workflows/
│ └── deploy-docs.yml # GitHub Actions 工作流
├── docs/
│ ├── source/
│ │ ├── .nojekyll # 防止 Jekyll 处理
│ │ ├── conf.py # Sphinx 配置
│ │ └── ... # 文档源文件
│ ├── build_multilang.py # 多语言构建脚本
│ ├── requirements.txt # Python 依赖
│ └── build/
│ └── html/ # 构建输出
│ ├── .nojekyll # 复制到输出目录
│ ├── index.html # 中文首页
│ └── en/ # 英文版本
│ └── index.html
├── README.md # 项目说明
└── DEPLOYMENT.md # 本文档
```

## 🛠️ 故障排除

### 常见问题

1. **构建失败**
- 检查 `requirements.txt` 中的依赖版本
- 查看 GitHub Actions 日志中的错误信息

2. **页面显示异常**
- 确保 `.nojekyll` 文件存在于输出目录
- 检查相对路径是否正确

3. **多语言切换不工作**
- 确认 `switcher.json` 文件已正确生成
- 检查语言切换器配置

### 调试步骤

1. **本地测试**
```bash
cd docs
python build_multilang.py
cd build/html
python -m http.server 8080
```

2. **检查构建日志**
- 在 GitHub 仓库的 Actions 标签页查看构建日志
- 查找错误信息和警告

3. **验证文件**
```bash
# 检查关键文件是否存在
ls docs/build/html/.nojekyll
ls docs/build/html/_static/switcher.json
ls docs/build/html/en/_static/switcher.json
```

## 📝 自定义配置

### 修改域名

如果使用自定义域名,需要:

1. 在 `docs/source/` 目录下创建 `CNAME` 文件
2. 在文件中写入你的域名(如 `docs.example.com`)
3. 修改 `build_multilang.py` 复制 CNAME 文件到输出目录

### 修改基础路径

如果仓库名不是 `enterprise-docs`,需要:

1. 修改 `docs/source/conf.py` 中的 `html_baseurl`
2. 更新 `switcher.json` 中的 URL 路径

## 🔄 更新流程

1. **修改文档**: 编辑 `docs/source/` 下的 `.rst` 文件
2. **本地测试**: 运行 `python build_multilang.py` 验证构建
3. **提交推送**: 提交更改并推送到 main 分支
4. **自动部署**: GitHub Actions 自动构建和部署
5. **验证结果**: 访问 GitHub Pages 地址确认更新

## 📊 监控

- **构建状态**: 查看仓库 README 中的构建徽章
- **部署历史**: 在 GitHub Actions 页面查看部署历史
- **访问统计**: 在 GitHub Insights 中查看页面访问情况
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
<div align="center">
<img src="https://github.com/xorbitsai/inference/blob/043b673dbd93f1cd5c8d6b0bb481f8d605cd24d2/assets/xorbits-logo.png" width="180px" alt="xorbits" />

# Xorbits Inference Enterprise
# Xorbits Inference Enterprise Documentation

<p align="center">
<a href="./README.md"><img alt="README in English" src="https://img.shields.io/badge/English-454545?style=for-the-badge"></a>
<a href="./README_zh_CN.md"><img alt="简体中文版自述文件" src="https://img.shields.io/badge/中文介绍-d9d9d9?style=for-the-badge"></a>
</p>

[![Deploy Documentation](https://github.com/xorbitsai/enterprise-docs/actions/workflows/deploy-docs.yml/badge.svg)](https://github.com/xorbitsai/enterprise-docs/actions/workflows/deploy-docs.yml)
[![GitHub Pages](https://img.shields.io/badge/GitHub%20Pages-Live-brightgreen)](https://xorbitsai.github.io/enterprise-docs/)

</div>
<br />
<br />

## 📚 Online Documentation

- **中文文档**: [https://xorbitsai.github.io/enterprise-docs/](https://xorbitsai.github.io/enterprise-docs/)
- **English Documentation**: [https://xorbitsai.github.io/enterprise-docs/en/](https://xorbitsai.github.io/enterprise-docs/en/)

## 🚀 Features

This repository contains comprehensive documentation for Xorbits Inference Enterprise, including:

- **Multi-platform Support**: NVIDIA, MindIE, Hygon hardware platforms
- **Deployment Guides**: Single-node and multi-node deployment configurations
- **Enterprise Features**: License management, performance monitoring, troubleshooting
- **Multilingual**: Full Chinese and English documentation
- **Interactive**: Live examples and configuration templates
Binary file modified docs/build/html/.doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/html/en/.doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/locale/.doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/locale/.doctrees/getting_started/index.doctree
Binary file not shown.
12 changes: 12 additions & 0 deletions docs/build_multilang.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ def build_language(lang, output_dir):
print(f"Successfully built {lang} documentation")
return True

def copy_nojekyll_file():
"""复制.nojekyll文件到输出目录"""
nojekyll_source = Path("source/.nojekyll")
if nojekyll_source.exists():
# 复制到中文版本根目录
shutil.copy2(nojekyll_source, "build/html/.nojekyll")
print("Copied .nojekyll to build/html/")

def update_switcher_config():
"""更新语言切换器配置"""
switcher_config = [
Expand Down Expand Up @@ -97,6 +105,10 @@ def main():
if not build_language('en', 'build/html/en'):
return False

# 复制.nojekyll文件
print("\n=== Copying .nojekyll file ===")
copy_nojekyll_file()

# 更新语言切换器配置
print("\n=== Updating language switcher ===")
update_switcher_config()
Expand Down
4 changes: 4 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sphinx>=7.0.0
sphinx-rtd-theme>=1.3.0
sphinx-intl>=2.1.0
sphinx-autosummary-accessors>=2023.4.0
Empty file added docs/source/.nojekyll
Empty file.
Loading