Improvements after code review #945
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: Deploy documentation | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - 'v*' | |
| concurrency: docs | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| if: github.repository_owner == 'It4innovations' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| # Download all git history to enable git revision history display in docs pages | |
| fetch-depth: 0 | |
| - name: Install stable toolchain | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| profile: minimal | |
| toolchain: 1.88.0 | |
| override: true | |
| components: clippy, rustfmt | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Set up Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: 3.9 | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip wheel setuptools | |
| python -m pip install -r docs/requirements.txt | |
| - name: Install cli_doc | |
| run: cargo install --git https://github.com/spirali/cli_doc | |
| - name: Build HyperQueue | |
| run: cargo build | |
| - name: Build docs | |
| run: mkdocs build | |
| - name: Set Git CI config | |
| run: | | |
| git config user.name gh-ci-deploy-docs | |
| git config user.email [email protected] | |
| - name: Calculate docs version | |
| run: | | |
| python3 scripts/get_docs_version.py > version.json | |
| cat version.json | |
| echo "VERSION=$(cat version.json)" >> $GITHUB_ENV | |
| - name: Deploy latest docs | |
| if: fromJson(env.VERSION).type == 'latest' | |
| run: mike deploy --push latest | |
| - name: Deploy stable docs | |
| if: fromJson(env.VERSION).type == 'stable' | |
| run: mike deploy --push -u ${{ fromJson(env.VERSION).version }} stable |