stick [email protected] (msrv) #2015
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: Python gh-pages doc | |
on: | |
pull_request: | |
release: | |
workflow_dispatch: | |
env: | |
CARGO_INCREMENTAL: false | |
FORCE_JAVASCRIPT_ACTIONS_TO_NODE20: true | |
jobs: | |
build_doc: | |
name: Build doc | |
runs-on: ubuntu-latest | |
if: github.repository == 'sonos/tract' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Extract version tag | |
id: version | |
if: github.event_name == 'release' && github.event.action == 'published' | |
run: echo value=$(echo ${{ github.ref }} | cut -f 3 -d / | tr -d 'v' ) >> $GITHUB_OUTPUT | |
- name: Build doc | |
run: | | |
set -ex | |
git config user.name "CI bot" | |
git config user.email [email protected] | |
git fetch origin gh-pages --depth=1 | |
cd api/py | |
sudo apt-get install -y python3-pip | |
pip3 install virtualenv | |
virtualenv pydocs | |
source pydocs/bin/activate | |
pip install --ignore-installed -r requirements-docs.txt | |
version=${{steps.version.outputs.value}} | |
if [ -n "$version" ] | |
then | |
mike deploy $version | |
else | |
mike deploy 0.21.dev | |
fi | |
git fetch | |
git rebase --onto origin/gh-pages gh-pages | |
- name: Publish doc | |
continue-on-error: true | |
run: | | |
cd api/py | |
git push origin -f gh-pages:gh-pages |