-
-
Notifications
You must be signed in to change notification settings - Fork 220
47 lines (37 loc) · 1.18 KB
/
docs.yml
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
41
42
43
44
45
46
47
name: Docs
on:
push:
branches:
- master
paths:
- mkdocs.yml
- docs/**
- .github/workflows/docs.yml
permissions:
contents: write
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- name: Install Python dependencies
run: pip install mkdocs-material==9.2.0b3 mkdocs-awesome-pages-plugin mkdocs-macros-plugin mkdocs-git-revision-date-localized-plugin mkdocs-glightbox
- name: Patch blog dates to support datetimes
run: sed -i 's|date.fromisoformat|datetime.fromisoformat|' $(pip show mkdocs-material | grep Location | cut -d ' ' -f 2)/material/plugins/blog/plugin.py
- name: Deploy to Github Pages
run: mkdocs gh-deploy --force
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}