deploy
This commit is contained in:
61
.github/workflows/deploy.yml
vendored
Normal file
61
.github/workflows/deploy.yml
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
name: Deploy VitePress to GitHub Pages
|
||||
|
||||
on:
|
||||
# 每次推送到main分支时触发部署
|
||||
push:
|
||||
branches: [main]
|
||||
# 允许手动触发工作流
|
||||
workflow_dispatch:
|
||||
|
||||
# 设置GITHUB_TOKEN的权限
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
# 只允许一个并发部署
|
||||
concurrency:
|
||||
group: pages
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
# 构建工作
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: npm
|
||||
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v4
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build with VitePress
|
||||
run: npm run docs:build
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: docs/.vitepress/dist
|
||||
|
||||
# 部署工作
|
||||
deploy:
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"editor.wordBasedSuggestions": "off"
|
||||
}
|
||||
60
README.md
Normal file
60
README.md
Normal file
@@ -0,0 +1,60 @@
|
||||
# 我的世界中国版 ModSDK Wiki 镜像
|
||||
|
||||
这是[我的世界中国版 ModSDK](https://mc.163.com/dev/) 官方文档的镜像站点,基于 VitePress 构建。本项目旨在提供完整的 ModSDK 文档参考,包括 API 文档、开发指南和教学课程。
|
||||
|
||||
## 项目结构
|
||||
|
||||
- `docs/` - 文档源文件
|
||||
- `mcdocs/` - API 文档
|
||||
- `mcguide/` - 开发指南
|
||||
- `mconline/` - 教学课程
|
||||
- `.vitepress/` - VitePress 配置
|
||||
- `scripts/` - 工具脚本
|
||||
|
||||
## 如何使用
|
||||
|
||||
### 安装依赖
|
||||
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
### 本地开发
|
||||
|
||||
启动开发服务器并实时预览文档:
|
||||
|
||||
```bash
|
||||
npm run docs:dev
|
||||
```
|
||||
|
||||
服务器启动后,可通过浏览器访问 `http://localhost:5173` 查看文档。
|
||||
|
||||
### 构建文档
|
||||
|
||||
生成静态文件用于部署:
|
||||
|
||||
```bash
|
||||
npm run docs:build
|
||||
```
|
||||
|
||||
构建完成后的文件将位于 `.vitepress/dist` 目录中。
|
||||
|
||||
### 预览构建结果
|
||||
|
||||
```bash
|
||||
npm run docs:preview
|
||||
```
|
||||
|
||||
## 贡献指南
|
||||
|
||||
1. Fork 本项目
|
||||
2. 创建功能分支 (`git checkout -b feature/amazing-feature`)
|
||||
3. 提交更改 (`git commit -m 'Add some amazing feature'`)
|
||||
4. 推送到分支 (`git push origin feature/amazing-feature`)
|
||||
5. 创建 Pull Request
|
||||
|
||||
## 相关链接
|
||||
|
||||
- [我的世界中国版 ModSDK 官网](https://mc.163.com/dev/)
|
||||
- [VitePress 文档](https://vitepress.dev/)
|
||||
- [GitHub 仓库](https://github.com/EaseCation/netease-modsdk-wiki)
|
||||
@@ -5,7 +5,7 @@ import generateSidebar from '../../scripts/sidebar.js';
|
||||
export default defineConfig({
|
||||
lang: 'zh-CN',
|
||||
title: "我的世界中国版 ModSDK",
|
||||
description: "我的世界中国版 ModSDK Wiki",
|
||||
description: "我的世界中国版 ModSDK Wiki 镜像",
|
||||
themeConfig: {
|
||||
// https://vitepress.dev/reference/default-theme-config
|
||||
nav: [
|
||||
|
||||
@@ -3,12 +3,11 @@
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"docs:dev": "vitepress dev docs",
|
||||
"docs:build": "vitepress build docs",
|
||||
"docs:preview": "vitepress preview docs"
|
||||
},
|
||||
"author": "",
|
||||
"author": "boybook",
|
||||
"license": "ISC",
|
||||
"description": "",
|
||||
"devDependencies": {
|
||||
|
||||
Reference in New Issue
Block a user