Publish tvm-ffi docs #9
This file contains hidden or 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: Publish tvm-ffi docs | |
on: | |
workflow_dispatch: | |
jobs: | |
build_wheels: | |
name: Build docs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: astral-sh/setup-uv@v4 | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
path: tvm-site | |
- name: Checkout tvm | |
uses: actions/checkout@v4 | |
with: | |
repository: apache/tvm | |
submodules: recursive | |
path: tvm | |
- name: Install wheel and requirements | |
working-directory: tvm/ffi | |
run: | | |
pip install . | |
pip install -r docs/requirements.txt | |
pip install linkify-it-py | |
cp ../../tvm-site/scripts/download_3rdparty_embeds.py docs | |
- name: Build docs | |
working-directory: tvm/ffi/docs | |
run: | | |
make html | |
python download_3rdparty_embeds.py -v | |
- name: Deploy docs | |
working-directory: tvm-site | |
run: | | |
git fetch | |
git checkout -B asf-site origin/asf-site | |
git ls-tree HEAD ffi/ --name-only | grep -vP '^ffi/v\\d' | xargs rm -rf | |
cp -r ../tvm/ffi/docs/_build/html ffi | |
git config user.name tvm-bot | |
git config user.email [email protected] | |
git add ffi | |
git commit -m"deploying ffi docs" ffi | |
git status | |
for i in {1..3}; do | |
if git push origin asf-site; then | |
echo "Push successful" | |
break | |
else | |
echo "Push failed, retrying ($i)..." | |
sleep 2 | |
git pull --rebase origin asf-site | |
fi | |
done | |