Skip to content

Commit 0a56c6e

Browse files
committed
feat: replace github page source from branch to action
1 parent e2f7800 commit 0a56c6e

File tree

1 file changed

+37
-15
lines changed

1 file changed

+37
-15
lines changed
Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,50 @@
11
name: Deploy MkDocs to GitHub Pages
22

3+
permissions:
4+
contents: read
5+
pages: write
6+
id-token: write
7+
38
on:
49
push:
5-
branches: [ main ]
10+
branches:
11+
- 'main'
12+
pull_request:
13+
branches:
14+
- 'main'
615

716
jobs:
8-
deploy:
17+
build:
918
runs-on: ubuntu-latest
10-
1119
steps:
12-
- uses: actions/checkout@v4
13-
14-
- uses: actions/setup-python@v4
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
- name: Setup Pages
23+
uses: actions/configure-pages@v5
24+
- name: Install Python
25+
uses: actions/setup-python@v4
1526
with:
1627
python-version: '3.13'
1728
cache: 'pip'
18-
19-
- run: pip install -r requirements.txt
20-
21-
- run: mkdocs build
22-
23-
- uses: peaceiris/actions-gh-pages@v3
29+
- name: Install Python Dependencies
30+
run: pip install -r requirements.txt
31+
- name: build site
32+
run: |
33+
mkdocs build
34+
echo -n '' > site/.nojekyll
35+
echo -n 'oss.hust.openatom.club' > site/CNAME
36+
- name: Upload artifact
37+
uses: actions/upload-pages-artifact@v3
2438
with:
25-
github_token: ${{ secrets.GITHUB_TOKEN }}
26-
publish_dir: ./site
27-
cname: oss.hust.openatom.club
39+
path: './site'
2840

41+
deploy:
42+
runs-on: ubuntu-latest
43+
needs: build
44+
environment:
45+
name: github-pages
46+
url: oss.hust.openatom.club
47+
steps:
48+
- name: Deploy to GitHub Pages
49+
id: deployment
50+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)