Skip to content

Commit 0330a5a

Browse files
committed
use github actions to deploy to github pages
1 parent 4b31786 commit 0330a5a

File tree

1 file changed

+31
-8
lines changed

1 file changed

+31
-8
lines changed

.github/workflows/build-mkdocs.yml

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,47 @@
1-
name: Build mkdocs
1+
name: mkdocs
22

33
on:
44
push:
55
branches:
6-
- master
76
- main
87
permissions:
98
contents: write
109
jobs:
11-
deploy:
10+
build_mkdocs:
1211
runs-on: ubuntu-latest
12+
1313
steps:
14-
- uses: actions/checkout@v4
15-
- uses: actions/setup-python@v4
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
- uses: actions/setup-python@v5
1619
with:
17-
python-version: 3.x
20+
python-version: 3.10
1821
- uses: actions/cache@v3
1922
with:
2023
key: ${{ github.ref }}
2124
path: .cache
22-
- run: pip install mkdocs-material
23-
- run: pip install mkdocs-redirects
25+
- run: pip install -r requirements.txt
2426
- run: mkdocs gh-deploy --force
27+
28+
deploy_mkdocs:
29+
needs: build_mkdocs
30+
environment:
31+
name: github-pages
32+
url: ${{ steps.deployment.outputs.page_url }}
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v4
37+
with:
38+
ref: gh-pages
39+
- name: Setup Pages
40+
uses: actions/configure-pages@v5
41+
- name: Upload artifact
42+
uses: actions/upload-pages-artifact@v3
43+
with:
44+
path: "."
45+
- name: Deploy to GitHub Pages
46+
id: deployment
47+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)