Skip to content

Commit 0633474

Browse files
author
sun
committed
Switch to GitHub Actions for Pages (Custom Workflow)
1 parent d4e3467 commit 0633474

1 file changed

Lines changed: 19 additions & 8 deletions

File tree

.github/workflows/deploy-docs.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ on:
44
branches:
55
- main
66
permissions:
7-
contents: write
7+
contents: read
88
pages: write
99
id-token: write
1010

1111
jobs:
12-
deploy:
12+
build:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v4
@@ -22,10 +22,21 @@ jobs:
2222
- name: Install dependencies
2323
run: |
2424
python3 -m pip install mkdocs-material
25-
- name: Build and Deploy
25+
- name: Build Documentation
2626
run: |
27-
git config --global user.name "github-actions[bot]"
28-
git config --global user.email "github-actions[bot]@users.noreply.github.com"
29-
python3 -m mkdocs gh-deploy --force
30-
env:
31-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
python3 -m mkdocs build --site-dir _site
28+
- name: Upload artifact
29+
uses: actions/upload-pages-artifact@v3
30+
with:
31+
path: _site
32+
33+
deploy:
34+
environment:
35+
name: github-pages
36+
url: ${{ steps.deployment.outputs.page_url }}
37+
runs-on: ubuntu-latest
38+
needs: build
39+
steps:
40+
- name: Deploy to GitHub Pages
41+
id: deployment
42+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)