-
Notifications
You must be signed in to change notification settings - Fork 238
85 lines (66 loc) · 1.73 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Publish Documentation
on:
push:
paths:
- .github/workflows/docs.yaml
- docs/**
- mkdocs.yml
- requirements-docs.txt
branches:
- main
- dev
release:
types:
- released
- prereleased
jobs:
prepare:
name: Get Current version
runs-on: ubuntu-22.04
outputs:
version: ${{ steps.version.outputs.value }}
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: Find Latest Tag
id: latest_tag
uses: oprypin/[email protected]
with:
repository: ${{ github.repository }}
regex: '^\d+\.\d+\.\d+$'
- name: Extract major and minor version
id: version
run: |
echo "value=`echo ${{ steps.latest_tag.outputs.tag }} | sed -r 's|([0-9]+.[0-9]+).*|\1|g'`" >> $GITHUB_OUTPUT
publish-docs:
name: Publish Docs
runs-on: ubuntu-22.04
needs:
- prepare
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.ACCESS_TOKEN }}
- name: Configurating Git
run: |
git config user.email "[email protected]"
git config user.name "Azory YData Bot"
git config core.autocrlf false
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Cache pip dependencies
id: cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
- name: Install doc dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-docs.txt
- name: Publish
run: make publish-docs version=${{ needs.prepare.outputs.version }}