-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (46 loc) · 1.62 KB
/
docs.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Deploy docs
on:
push:
branches:
- main
paths:
- docs/**
- mkdocs.yaml
workflow_dispatch:
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
if: github.event.repository.fork == false
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Run generate cache key
run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-cache-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-
- name: Run setup mkdocs dependencies
run: pip install mkdocs mkdocs-material mkdocs-autolinks-plugin mkdocs-drawio-file mkdocs-git-revision-date-localized-plugin fontawesome_markdown mike pymdown-extensions
- name: Run mkdocs deployment
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
mike deploy -b gh-pages -p -F mkdocs.yaml -u next
- name: Run mkdocs release deployment
if: "contains(github.event.head_commit.message, 'docs: release')"
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
LATEST_TAG=$(git describe --abbrev=0)
SHORT_VERSION=${LATEST_TAG%.*}
mike deploy -b gh-pages -p -F mkdocs.yaml -u ${SHORT_VERSION} latest