-
Notifications
You must be signed in to change notification settings - Fork 5
43 lines (42 loc) · 1.19 KB
/
build_versioned_mkdocs.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
name: Build Documentation
on:
push:
branches:
- dev
tags:
- '*'
#paths:
# - 'docs/**'
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
jobs:
mkdocs_build:
runs-on: ubuntu-latest
steps:
- name: Get branch name
id: branch-names
uses: tj-actions/branch-names@v8
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.10.14
- name: Install dependencies
run: pip install mkdocs mkdocs-material mkdocstrings "mkdocstrings[python]" mike
- name: Git Config
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "<>"
- name: Build dev version
if: steps.branch-names.outputs.current_branch == 'dev'
run: mike deploy --push dev
- name: Build release
#if: steps.branch-names.outputs.current_branch == 'main'
if: steps.branch-names.outputs.is_tag == 'true'
run: mike deploy --push --update-aliases ${{ steps.branch-names.outputs.tag }} latest