Skip to content

Commit 4cf0026

Browse files
NeoNeo
authored andcommitted
添加 GitHub Pages 自动启用配置和故障排除说明
1 parent f7bf22d commit 4cf0026

2 files changed

Lines changed: 27 additions & 2 deletions

File tree

.github/DEPLOYMENT.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@
44

55
## 部署步骤
66

7-
### 1. 启用 GitHub Pages
7+
### 1. 启用 GitHub Pages(必需的第一步)
8+
9+
**重要**:在首次部署之前,必须先手动启用 GitHub Pages:
810

911
1. 前往 GitHub 仓库的 **Settings** > **Pages**
12+
- 直接访问:`https://github.com/zeeklog/pptking/settings/pages`
1013
2.**Source** 部分,选择 **GitHub Actions** 作为部署源
11-
3. 保存设置
14+
3. 点击 **Save** 保存设置
15+
16+
**注意**:如果看到 "Get Pages site failed" 错误,说明 Pages 尚未启用。请先完成上述步骤,然后重新运行工作流。
1217

1318
### 2. 配置环境变量
1419

@@ -52,6 +57,23 @@ npx serve out
5257

5358
## 故障排除
5459

60+
### "Get Pages site failed" 错误
61+
62+
如果工作流报错 "Get Pages site failed",请按以下步骤操作:
63+
64+
1. **确保已手动启用 GitHub Pages**
65+
- 访问:`https://github.com/zeeklog/pptking/settings/pages`
66+
-**Source** 中选择 **GitHub Actions**
67+
- 点击 **Save**
68+
69+
2. **检查权限**
70+
- 确保仓库有 Pages 功能(公开仓库或 GitHub Pro/Team 账户)
71+
- 确保工作流有正确的权限(已在工作流中配置)
72+
73+
3. **重新运行工作流**
74+
- 在 Actions 标签页中,点击失败的工作流
75+
- 点击 **Re-run all jobs**
76+
5577
### 构建失败
5678

5779
- 检查 GitHub Actions 日志中的错误信息

.github/workflows/deploy-pages.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ permissions:
1010
contents: read
1111
pages: write
1212
id-token: write
13+
administration: write
1314

1415
concurrency:
1516
group: "pages"
@@ -29,6 +30,8 @@ jobs:
2930

3031
- name: Setup Pages
3132
uses: actions/configure-pages@v4
33+
with:
34+
enablement: true
3235

3336
- name: Install dependencies
3437
run: |

0 commit comments

Comments
 (0)