-
Notifications
You must be signed in to change notification settings - Fork 402
77 lines (66 loc) · 2.7 KB
/
Copy pathdocs_build.yaml
File metadata and controls
77 lines (66 loc) · 2.7 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Build Documentation
on:
workflow_dispatch: null
release:
types:
- published
permissions:
contents: write
jobs:
deploy_docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: # zizmor: ignore[artipacked]
fetch-depth: 0
token: ${{ secrets.AUTOMERGE_TOKEN }}
- uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1
with:
version: "latest"
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: 3.12
- name: Install dependencies
run: |
set -ux
uv pip install --system --group dev -e .
uv pip uninstall --system email-validator # This is to fix broken link in docs
- name: Install Just
uses: extractions/setup-just@f8a3cce218d9f83db3a2ecd90e41ac3de6cdfd9b # v3.1.0
with:
just-version: 1.42.4
- name: Build API Reference
run: just docs-build-api
- 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
- run: echo $VERSION
- run: echo $IS_RC
- name: Configure Git user
run: |
git config --local user.email "faststream-actions[bot]@users.noreply.github.com"
git config --local user.name "faststream-actions[bot]"
- name: Build docs
run: |
if [ "$IS_RC" == "False" ]; then
cd docs
mike deploy -F mkdocs.yml --update-aliases $VERSION latest
mike set-default --allow-empty -F mkdocs.yml latest
# Doc commits are large, keep only the last one
git checkout gh-pages
git reset --soft HEAD~3
else
cd docs
mike deploy -F mkdocs.yml --update-aliases $VERSION
# Doc commits are large, keep only the last one
git checkout gh-pages
git reset --soft HEAD~2
fi
- name: Commit
uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v7.1.0
with:
branch: gh-pages
push_options: "--force" # force push to stay with clear gh-pages branch history
commit_message: "docs: deploy docs"
commit_user_name: faststream-actions[bot]
commit_user_email: faststream-actions[bot]@users.noreply.github.com
commit_author: faststream-actions[bot] <faststream-actions[bot]@users.noreply.github.com>