name: Publish release docs
on:
  release:
    types: [released]
      
jobs:
  main:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - uses: actions/setup-python@v2
        with:
          python-version: 3.8
      - run: pip3 install -r .github/workflows/requirements.txt -U
      - run: git config --global user.email "github-action@users.noreply.github.com"
      - run: git config --global user.name "GitHub Action"
      - run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
      - run: |
          cd .docssite
          mike deploy --push --update-aliases $RELEASE_VERSION latest