-
Notifications
You must be signed in to change notification settings - Fork 59
41 lines (41 loc) · 1.25 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
name: Build and publish docs
on:
pull_request:
push:
branches: [develop]
release:
types: [released]
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: actions/setup-node@v4
with:
node-version: 20.x
- uses: actions/cache@v4
with:
path: ~/.cache/pip3
key: ${{ runner.os }}-pip-${{ hashFiles('docs/requirements.txt') }}
- uses: actions/cache@v4
with:
path: |
~/.npm
~/.autorest
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
- run: pip3 install -r docs/requirements.txt
- run: git config --global user.email "[email protected]"
- run: git config --global user.name "GitHub Action"
- if: github.event_name == 'pull_request'
run: mkdocs build
- if: github.event_name == 'push'
run: mike deploy --push develop
- if: github.event_name == 'release'
run: |
echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
mike deploy --push --update-aliases $RELEASE_VERSION latest