Skip to content

Commit 08df6ce

Browse files
authored
Update GitHub Actions workflow for MkDocs deployment
1 parent 3ac5bb8 commit 08df6ce

File tree

1 file changed

+30
-20
lines changed

1 file changed

+30
-20
lines changed

.github/workflows/deploy.yml

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,33 @@
11
name: Deploy MkDocs to GitHub Pages
2+
23
on:
3-
push:
4-
branches:
5-
- main
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
611
jobs:
7-
deploy:
8-
runs-on: ubuntu-latest
9-
steps:
10-
- name: Checkout Code
11-
uses: actions/checkout@v2
12-
- name: Setup Python
13-
uses: actions/setup-python@v2
14-
with:
15-
python-version: '3.x'
16-
- name: Install Dependencies
17-
run: |
18-
pip install mkdocs
19-
- name: Build and Deploy
20-
run: |
21-
mkdocs gh-deploy --force
22-
env:
23-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12+
deploy:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repo
16+
uses: actions/checkout@v3
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: '3.x'
22+
23+
- name: Install MkDocs
24+
run: pip install mkdocs
25+
26+
- name: Build site
27+
run: mkdocs build
28+
29+
- name: Deploy to GitHub Pages
30+
uses: peaceiris/actions-gh-pages@v3
31+
with:
32+
github_token: ${{ secrets.GITHUB_TOKEN }}
33+
publish_dir: ./site

0 commit comments

Comments
 (0)