v0.6.4 #23
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Documentation | |
| on: | |
| workflow_dispatch: null | |
| release: | |
| types: | |
| - published | |
| permissions: | |
| contents: write | |
| jobs: | |
| deploy_docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 | |
| with: # zizmor: ignore[artipacked] | |
| fetch-depth: 0 | |
| token: ${{ secrets.AUTOMERGE_TOKEN }} | |
| - uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4 | |
| with: | |
| version: "latest" | |
| - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.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@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3.0.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@28e16e81777b558cc906c8750092100bbb34c5e3 # v7.0.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> |