Skip to content

Commit e7f67e7

Browse files
committed
Workflow for ffi docs
1 parent 0b25fd8 commit e7f67e7

File tree

3 files changed

+96
-0
lines changed

3 files changed

+96
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Publish tvm-ffi docs
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build_wheels:
8+
name: Build docs
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: astral-sh/setup-uv@v4
12+
13+
- uses: actions/checkout@v4
14+
with:
15+
submodules: recursive
16+
path: tvm-site
17+
18+
- name: Checkout tvm
19+
uses: actions/checkout@v4
20+
with:
21+
repository: apache/tvm
22+
submodules: recursive
23+
path: tvm
24+
25+
- name: Install wheel and requirements
26+
working-directory: tvm/ffi
27+
run: |
28+
pip install .
29+
pip install -r docs/requirements.txt
30+
pip install linkify-it-py
31+
cp ../../tvm-site/scripts/download_3rdparty_embeds.py docs
32+
33+
- name: Build docs
34+
working-directory: tvm/ffi/docs
35+
run: |
36+
make html
37+
python download_3rdparty_embeds.py -v
38+
39+
- name: Deploy docs
40+
working-directory: tvm-site
41+
run: |
42+
git status
43+
git checkout -B asf-site
44+
git pull --rebase origin asf-site
45+
git ls-tree HEAD ffi/ --name-only | grep -vP '^ffi/v\\d' | xargs rm -rf
46+
cp -r ../tvm/ffi/docs/_build/html ffi
47+
git add .
48+
git config user.name tvm-bot
49+
git config user.email [email protected]
50+
git commit -m"deploying ffi docs"
51+
git status
52+
for i in {1..3}; do
53+
if git push origin asf-site; then
54+
echo "Push successful"
55+
break
56+
else
57+
echo "Push failed, retrying ($i)..."
58+
sleep 2
59+
git pull --rebase origin asf-site
60+
fi
61+
done
62+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Build Jekyll Site
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Ruby
17+
uses: ruby/setup-ruby@v1
18+
with:
19+
ruby-version: 3.4
20+
bundler-cache: true
21+
22+
- name: Install dependencies
23+
run: |
24+
bundle install
25+
26+
- name: Build website
27+
run: |
28+
./scripts/task_deploy_asf_site.sh

scripts/task_deploy_asf_site.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@ git ls-files | grep -v -e ^docs -e ^ffi | xargs rm -rf
1818
cp .gitignore.bak .gitignore
1919
cp .asf.yaml.bak .asf.yaml
2020

21+
if [ "$GITHUB_ACTIONS" = "true" ]; then
22+
git config user.name tvm-bot
23+
git config user.email [email protected]
24+
fi
25+
2126
cp -rf _site/* .
27+
rm -rf _site
2228
DATE=`date`
2329
git add --all && git commit -am "Build at ${DATE}"
2430
git push origin asf-site

0 commit comments

Comments
 (0)