name: docs on: push: branches: - develop tags: - "v[0-9]+.[0-9]+.[0-9]+" jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: fetch-depth: 0 - uses: actions/setup-python@v2 with: python-version: 3.x - run: pip install git+https://${GH_TOKEN}@github.com/carissalow/mkdocs-material-insiders.git - run: pip install mike - run: | git config user.name github-actions git config user.email github-actions@github.com - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - run: echo "DOCS_TAG=$(echo $RELEASE_VERSION | sed -n "s/v\([0-9]\+\.[0-9]\+\).*$/\1/p")" >> $GITHUB_ENV - if: startsWith(github.ref, 'refs/tags') run: mike deploy --push --update-aliases $DOCS_TAG latest - if: ${{ github.ref == 'refs/heads/develop' }} run: mike deploy --push --update-aliases dev env: GH_TOKEN: ${{ secrets.GH_TOKEN }}