Fix icevision master branch #2072
Workflow file for this run
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: Build mkdocs | |
on: | |
pull_request: | |
branches: [master] | |
push: | |
branches: [master] | |
release: | |
types: [created] | |
env: | |
SITE_BRANCH: ${{ 'gh-pages-ver' }} | |
jobs: | |
build-docs: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install package | |
run: pip install -e .[dev] | |
- name: Prepare the docs | |
run: | | |
cd docs | |
python autogen.py | |
- name: Setup git config | |
run: | | |
git config user.name "GitHub Actions Bot" | |
git config user.email "[email protected]" | |
- name: Build the docs locally only | |
if: github.event_name == 'pull_request' | |
run: | | |
cd docs | |
mike deploy dev -b ${{ env.SITE_BRANCH }} | |
- name: Deploy dev docs | |
id: deploy_dev | |
if: github.repository == 'airctic/icevision' && github.event_name == 'push' | |
run: | | |
cd docs | |
mike deploy dev -b ${{ env.SITE_BRANCH }} -p | |
echo '::set-output name=MIKE_VERSIONS::'$(mike list -b ${{ env.SITE_BRANCH }} | wc -l) | |
- name: Set dev as default | |
if: steps.deploy_dev.outputs.MIKE_VERSIONS == 1 | |
run: | | |
cd docs | |
mike set-default -b ${{ env.SITE_BRANCH }} dev -p | |
- name: Get latest release tag | |
if: github.event_name == 'release' && !github.event.release.prerelease | |
id: latest | |
uses: pozetroninc/github-action-get-latest-release@master | |
with: | |
excludes: prerelease | |
repository: ${{ github.repository }} | |
- name: Release docs | |
if: github.event_name == 'release' && !github.event.release.prerelease | |
run: | | |
cd docs | |
echo Deploy as ${{ steps.latest.outputs.release }} | |
mike deploy -b ${{ env.SITE_BRANCH }} ${{ steps.latest.outputs.release }} -p | |
mike set-default -b ${{ env.SITE_BRANCH }} ${{ steps.latest.outputs.release }} -p |