-
Notifications
You must be signed in to change notification settings - Fork 19
60 lines (51 loc) · 1.47 KB
/
docs.yml
File metadata and controls
60 lines (51 loc) · 1.47 KB
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
55
56
57
58
59
60
name: Deploy docs
on:
workflow_call:
inputs:
version:
description: 'Version to deploy (e.g., v0.1.0)'
required: true
type: string
workflow_dispatch:
inputs:
version:
description: 'Version to deploy (e.g., v0.1.0)'
required: true
type: string
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: pip install mkdocs-material mike
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Extract version number
id: version
run: |
# v0.1.0 -> 0.1
VERSION="${{ inputs.version }}"
VERSION="${VERSION#v}"
VERSION="${VERSION%.*}"
echo "short=$VERSION" >> $GITHUB_OUTPUT
- name: Deploy docs
run: |
mike deploy ${{ steps.version.outputs.short }} latest --update-aliases --push
mike set-default latest --push
- name: Ensure CNAME exists
run: |
git checkout gh-pages
echo "fastopenapi.fatalyst.dev" > CNAME
git add CNAME
git diff --cached --quiet || git commit -m "Add CNAME"
git push origin gh-pages