Skip to content

Fix icevision master branch #2062

Fix icevision master branch

Fix icevision master branch #2062

Workflow file for this run

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-18.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install package
run: |
sh ./icevision_install.sh cpu
pip install -e ".[all,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