Skip to content

Commit b8604c0

Browse files
author
54895y
committed
网站提交
0 parents  commit b8604c0

File tree

128 files changed

+25868
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+25868
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'docs/**'
9+
- 'src/**'
10+
- 'static/**'
11+
- 'docusaurus.config.ts'
12+
- 'sidebars.ts'
13+
- 'package.json'
14+
- 'package-lock.json'
15+
16+
jobs:
17+
deploy:
18+
name: Deploy to GitHub Pages
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
22+
pages: write
23+
id-token: write
24+
environment:
25+
name: github-pages
26+
url: https://54895y.github.io
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
31+
- name: Setup Node
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: '20'
35+
cache: 'npm'
36+
37+
- name: Install dependencies
38+
run: npm ci
39+
40+
- name: Build
41+
run: npm run build
42+
43+
- name: Upload artifact
44+
uses: actions/upload-pages-artifact@v3
45+
with:
46+
path: ./build
47+
48+
- name: Deploy to GitHub Pages
49+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*

DEPLOYMENT.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# GitHub Pages 部署指南
2+
3+
## 配置完成情况
4+
5+
✅ 已完成以下配置:
6+
7+
1. **Docusaurus 配置更新** (`docusaurus.config.ts`)
8+
- `url`: `https://54895y.github.io`
9+
- `baseUrl`: `/`
10+
- `organizationName`: `54895y`
11+
- `projectName`: `54895y.github.io`
12+
- GitHub 链接已更新
13+
14+
2. **GitHub Actions 工作流** (`.github/workflows/deploy.yml`)
15+
- 自动触发部署
16+
- Node.js 20 环境
17+
- 自动构建和部署
18+
19+
3. **CNAME 文件** (`static/CNAME`)
20+
- 设置为 `54895y.github.io`
21+
22+
4. **README 文档** (`README.md`)
23+
- 添加了部署说明
24+
25+
## 部署步骤
26+
27+
### 1. 提交代码到 GitHub
28+
29+
```bash
30+
git add .
31+
git commit -m "配置 GitHub Pages 部署"
32+
git push origin main
33+
```
34+
35+
### 2. 启用 GitHub Pages
36+
37+
1. 访问 https://github.com/54895y/54895y.github.io/settings/pages
38+
2. 在 "Build and deployment" 部分:
39+
- Source: **GitHub Actions**
40+
- Branch: **main**
41+
3. 点击 "Save"
42+
43+
### 3. 等待部署完成
44+
45+
- 首次部署可能需要 2-5 分钟
46+
- 部署完成后,网站将自动在 https://54895y.github.io 上线
47+
48+
### 4. 验证部署
49+
50+
访问 https://54895y.github.io 查看网站是否正常显示。
51+
52+
## 自动部署说明
53+
54+
每次向 `main` 分支推送以下文件的更改时,都会自动触发部署:
55+
56+
- `docs/**` - 文档内容
57+
- `src/**` - 源代码
58+
- `static/**` - 静态资源
59+
- `docusaurus.config.ts` - 配置文件
60+
- `sidebars.ts` - 侧边栏配置
61+
- `package.json` / `package-lock.json` - 依赖文件
62+
63+
## 手动触发部署
64+
65+
如果需要手动触发部署,可以:
66+
67+
1. 在 GitHub 仓库页面点击 "Actions" 标签
68+
2. 选择 "Deploy to GitHub Pages" 工作流
69+
3. 点击 "Run workflow" → "Run workflow"
70+
71+
## 故障排除
72+
73+
### 网站无法访问
74+
75+
1. 检查 GitHub Pages 设置是否正确
76+
2. 确认分支设置为 `main`
77+
3. 查看 Actions 标签页中的部署日志
78+
79+
### 内容未更新
80+
81+
1. 等待 1-2 分钟让 GitHub Pages 更新
82+
2. 清除浏览器缓存
83+
3. 检查 GitHub Actions 是否成功完成
84+
85+
### 自定义域名
86+
87+
如果要使用自定义域名:
88+
89+
1.`static/CNAME` 文件中添加你的域名
90+
2. 在 GitHub 仓库设置中配置自定义域名
91+
3. 确保 DNS 记录正确配置

DEPLOYMENT_GUIDE.md

Lines changed: 219 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,219 @@
1+
# 🚀 GitHub Pages 完整部署指南
2+
3+
## 前提条件
4+
5+
- 已安装 Git
6+
- 已创建 GitHub 账号
7+
- 已创建仓库 `https://github.com/54895y/54895y.github.io`
8+
9+
---
10+
11+
## 第一步:初始化 Git 仓库
12+
13+
### 1. 打开命令行
14+
15+
`Win + R`,输入 `cmd`,按回车
16+
17+
### 2. 进入项目目录
18+
19+
```bash
20+
cd "D:\我的世界\Minecraft代码\MatrixShop\matrixshop-docs"
21+
```
22+
23+
### 3. 初始化 Git 仓库
24+
25+
```bash
26+
git init
27+
```
28+
29+
### 4. 配置 Git 用户信息
30+
31+
```bash
32+
git config --global user.name "54895y"
33+
git config --global user.email "54895y@example.com"
34+
```
35+
36+
> **注意**: 将 `54895y@example.com` 替换为你 GitHub 账号的邮箱
37+
38+
---
39+
40+
## 第二步:添加文件并提交
41+
42+
### 1. 查看当前状态
43+
44+
```bash
45+
git status
46+
```
47+
48+
### 2. 添加所有文件
49+
50+
```bash
51+
git add .
52+
```
53+
54+
### 3. 提交文件
55+
56+
```bash
57+
git commit -m "Initial commit: MatrixShop documentation with GitHub Pages setup"
58+
```
59+
60+
---
61+
62+
## 第三步:连接远程仓库
63+
64+
### 1. 创建 GitHub 仓库
65+
66+
1. 访问 https://github.com/new
67+
2. Repository name: `54895y.github.io`
68+
3. Description: `MatrixShop Documentation`
69+
4. 选择 **Public**
70+
5. **不要**勾选 "Initialize this repository with a README"
71+
6. 点击 "Create repository"
72+
73+
### 2. 添加远程仓库
74+
75+
```bash
76+
git remote add origin https://github.com/54895y/54895y.github.io.git
77+
```
78+
79+
### 3. 推送代码到 GitHub
80+
81+
```bash
82+
git branch -M main
83+
git push -u origin main
84+
```
85+
86+
> **注意**: 如果提示输入用户名和密码,请使用 GitHub Personal Access Token
87+
88+
---
89+
90+
## 第四步:启用 GitHub Pages
91+
92+
### 1. 访问仓库设置
93+
94+
1. 打开 https://github.com/54895y/54895y.github.io
95+
2. 点击右上角的 **Settings** 标签
96+
97+
### 2. 配置 Pages
98+
99+
1. 在左侧菜单中找到 **Pages**
100+
2. 点击 **Pages**
101+
3. 在 "Build and deployment" 部分:
102+
- Source: **GitHub Actions**
103+
- Branch: **main**
104+
4. 点击 **Save**
105+
106+
### 3. 等待部署
107+
108+
- 首次部署需要 2-5 分钟
109+
- 部署完成后会显示网站 URL: `https://54895y.github.io`
110+
111+
---
112+
113+
## 第五步:验证部署
114+
115+
### 1. 访问网站
116+
117+
打开浏览器,访问: **https://54895y.github.io**
118+
119+
### 2. 检查网站内容
120+
121+
确认以下内容正常显示:
122+
- 主页 Hero 区域
123+
- MatrixShop 卡片
124+
- 更多插件卡片
125+
- 技术栈部分
126+
- 快速开始部分
127+
128+
---
129+
130+
## 第六步:后续更新
131+
132+
### 自动部署
133+
134+
每次向 `main` 分支推送以下文件的更改时,都会自动部署:
135+
136+
```bash
137+
# 修改文件后
138+
git add .
139+
git commit -m "Update documentation"
140+
git push origin main
141+
```
142+
143+
### 查看部署状态
144+
145+
1. 访问 https://github.com/54895y/54895y.github.io/actions
146+
2. 查看最新的工作流运行状态
147+
3. 点击工作流可以查看详细日志
148+
149+
---
150+
151+
## 常见问题
152+
153+
### 1. 网站无法访问
154+
155+
**问题**: 访问 https://54895y.github.io 显示 404
156+
157+
**解决方案**:
158+
- 等待 5-10 分钟让 GitHub Pages 更新
159+
- 清除浏览器缓存
160+
- 检查 GitHub Pages 设置是否正确
161+
162+
### 2. Git Push 失败
163+
164+
**问题**: `fatal: repository not found`
165+
166+
**解决方案**:
167+
- 检查仓库 URL 是否正确
168+
- 确认仓库是公开的
169+
- 检查网络连接
170+
171+
### 3. 权限问题
172+
173+
**问题**: `Permission denied (publickey)`
174+
175+
**解决方案**:
176+
- 配置 SSH 密钥或使用 HTTPS
177+
- 使用 Personal Access Token 替代密码
178+
179+
### 4. 内容未更新
180+
181+
**问题**: 网站内容没有显示最新更改
182+
183+
**解决方案**:
184+
- 等待 1-2 分钟让 GitHub Pages 更新
185+
- 检查 GitHub Actions 是否成功完成
186+
- 清除浏览器缓存
187+
188+
---
189+
190+
## 快速命令参考
191+
192+
```bash
193+
# 初始化
194+
cd "D:\我的世界\Minecraft代码\MatrixShop\matrixshop-docs"
195+
git init
196+
git config --global user.name "54895y"
197+
git config --global user.email "54895y@example.com"
198+
199+
# 添加和提交
200+
git add .
201+
git commit -m "Initial commit"
202+
203+
# 连接远程仓库
204+
git remote add origin https://github.com/54895y/54895y.github.io.git
205+
git branch -M main
206+
git push -u origin main
207+
```
208+
209+
---
210+
211+
## 部署成功后
212+
213+
部署成功后,你将拥有:
214+
- ✅ 网站 URL: https://54895y.github.io
215+
- ✅ 自动部署功能
216+
- ✅ GitHub 仓库管理
217+
- ✅ 文档版本控制
218+
219+
祝你使用愉快!🎉

0 commit comments

Comments
 (0)