-
-
Notifications
You must be signed in to change notification settings - Fork 2
40 lines (38 loc) · 1.05 KB
/
deploy-mkdocs.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: MkDocs Build and Deploy
on:
workflow_dispatch:
# push:
# branches: main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: actions/cache@v3
with:
key: ${{ github.ref }}
path: site
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install mkdocs mkdocs-material
- name: Build static files
run: mkdocs build
- name: Building gh-pages repo
working-directory: site
run: |
git init -b gh-pages
git config --global user.email "actions@github.com"
git config --global user.name "github-actions"
git add -A
git commit -m "Update static files"
- name: Pushing static files
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
directory: site
force: true