-
Notifications
You must be signed in to change notification settings - Fork 169
43 lines (42 loc) · 1.4 KB
/
deploy-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
name: Deploy Docs
on:
push:
branches:
- main
paths:
- docs/**
- .github/workflows/deploy-docs.yaml
- faststream/__about__.py
permissions:
contents: write
jobs:
deploy_docs:
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/cache@v4
with:
key: ${{ github.ref }}
path: .cache
- run: pip install -e ".[dev]"
- run: ./scripts/build-docs.sh
- run: echo "VERSION=$(python3 -c 'from importlib.metadata import version; print(".".join(version("faststream").split(".")[:2]))')" >> $GITHUB_ENV
- run: echo "IS_RC=$(python3 -c 'from importlib.metadata import version; print("rc" in version("faststream"))')" >> $GITHUB_ENV
- name: Configure Git user
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- run: echo $VERSION
- run: echo $IS_RC
- run: |
if [ "$IS_RC" == "False" ]; then
cd docs && mike deploy -F mkdocs.yml --update-aliases $VERSION latest
mike set-default --push --allow-empty -F mkdocs.yml latest
else
cd docs && mike deploy --push -F mkdocs.yml --update-aliases $VERSION
fi