Skip to content

Commit 5c5a6cd

Browse files
committed
Feat: Adopt recommended GitHub Pages deployment workflow
1 parent 4bf4cd5 commit 5c5a6cd

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,31 @@ jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212

13+
permissions:
14+
contents: write
15+
1316
steps:
1417
- name: Checkout repository
1518
uses: actions/checkout@v4
16-
19+
with:
20+
persist-credentials: false
1721
- name: Set up Python
1822
uses: actions/setup-python@v5
1923
with:
20-
python-version: '3.x' # 使用 3.x 版本的 Python
24+
python-version: '3.x'
2125

2226
- name: Install dependencies
2327
run: |
2428
python -m pip install --upgrade pip
25-
pip install -r requirements.txt # 假设您已经创建了 requirements.txt
29+
pip install -r requirements.txt
2630
2731
- name: Build HTML
28-
run: |
29-
make html # 或者使用 sphinx-build source build/html
32+
run: make html
33+
34+
- name: Deploy
35+
uses: peaceiris/actions-gh-pages@v3
36+
# if: github.ref == 'refs/heads/main'
37+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
38+
with:
39+
github_token: ${{ secrets.GITHUB_TOKEN }}
40+
publish_dir: build/html

0 commit comments

Comments
 (0)