Update guidelines for version check and add script for version check #423
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: Docs | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - '**.md' | |
| - '**.yml' | |
| tags: | |
| - 'v*.*.*' | |
| jobs: | |
| docs: | |
| runs-on: ubuntu-latest | |
| name: Build and deploy docs | |
| steps: | |
| - uses: actions/checkout@master | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v2 | |
| with: | |
| python-version: 3.8 | |
| - name: Build and deploy documentation | |
| run: | | |
| python3 -m pip install mkdocs pymdown-extensions mkdocs-material mike | |
| git fetch origin gh-pages --depth=1 | |
| git config user.name ci-bot | |
| git config user.email [email protected] | |
| if [[ "$GITHUB_REF" == refs/tags/* ]]; then | |
| # Tag push: deploy the tag version | |
| TAG_VERSION=${GITHUB_REF#refs/tags/} | |
| echo "Deploying docs for tag $TAG_VERSION" | |
| mike deploy --push $TAG_VERSION | |
| else | |
| # Main branch push: deploy to 'main' | |
| echo "Deploying docs for main branch" | |
| mike deploy --push main | |
| fi |