Skip to content

Commit d9e41ac

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

File tree

3 files changed

+93
-0
lines changed

3 files changed

+93
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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 fetch
43+
git checkout -B asf-site origin/asf-site
44+
git ls-tree HEAD ffi/ --name-only | grep -vP '^ffi/v\\d' | xargs rm -rf
45+
cp -r ../tvm/ffi/docs/_build/html ffi
46+
git config user.name tvm-bot
47+
git config user.email [email protected]
48+
git add ffi
49+
git commit -m"deploying ffi docs" ffi
50+
git status
51+
for i in {1..3}; do
52+
if git push origin asf-site; then
53+
echo "Push successful"
54+
break
55+
else
56+
echo "Push failed, retrying ($i)..."
57+
sleep 2
58+
git pull --rebase origin asf-site
59+
fi
60+
done
61+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Build Jekyll Site
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v4
13+
14+
- name: Set up Ruby
15+
uses: ruby/setup-ruby@v1
16+
with:
17+
ruby-version: 3.4
18+
bundler-cache: true
19+
20+
- name: Install dependencies
21+
run: |
22+
bundle install
23+
24+
- name: Build website
25+
run: |
26+
./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)