chore: update dependencies #58
This file contains 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: Documentation | |
on: | |
push: | |
branches: [ 'main' ] | |
workflow_call: | |
inputs: | |
version: | |
description: The version tag (v0.1.2) | |
required: false | |
type: string | |
jobs: | |
documentation: | |
name: Build documentation | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
env: | |
GR_VERSION_TAG: ${{ inputs.version || 'next' }} | |
if: ${{ github.event_name != 'pull_request' }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: '0' | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
- run: git fetch origin gh-pages --depth=1 | |
- run: | | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
- run: | | |
pip install \ | |
mkdocs-material \ | |
mkdocs-macros-plugin \ | |
mike | |
- name: Set version env | |
if: ${{ env.GR_VERSION_TAG != 'next' }} | |
# v1.2.3 -> | |
# GR_FULL_VERSION=1.2.3 | |
# GR_SHORT_VERSION=1.2 | |
# GR_PATCH_VERSION=2 | |
run: | | |
echo "GR_FULL_VERSION=$(echo $GR_VERSION_TAG | cut -d '/' -f 3 | cut -c2-)" >> $GITHUB_ENV | |
echo "GR_SHORT_VERSION=$(echo $GR_VERSION_TAG | cut -d '/' -f 3 | cut -d '.' -f 1,2 | cut -c2-)" >> $GITHUB_ENV | |
echo "GR_PATCH_VERSION=$(echo $GR_VERSION_TAG | cut -d '/' -f 3 | cut -d '.' -f 3)" >> $GITHUB_ENV | |
# If it is a major or minor, we mark it as latest and default. | |
- if: ${{ env.GR_PATCH_VERSION == '0' && env.GR_VERSION_TAG != 'next' }} | |
run: | | |
mike deploy --update-aliases --push ${{ env.GR_SHORT_VERSION }} latest | |
mike list | |
working-directory: docs | |
# If it is a patch, we don't set it at latest | |
- if: ${{ env.GR_PATCH_VERSION != '0' && env.GR_VERSION_TAG != 'next' }} | |
run: | | |
mike deploy --update-aliases --push ${{ env.GR_SHORT_VERSION }} | |
mike list | |
working-directory: docs | |
- if: ${{ env.GR_VERSION_TAG == 'next' }} | |
run: | | |
mike deploy --update-aliases --push next | |
mike list | |
working-directory: docs | |
- run: | | |
mike set-default --push latest | |
mike list | |
working-directory: docs |