forked from mlc-ai/mlc-llm
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gihhub actions for docs (mlc-ai#245)
This PR adds GH actions for docs
- Loading branch information
Showing
9 changed files
with
134 additions
and
35 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,39 @@ | ||
name: Documentation | ||
name: Build Docs | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- “docs/” | ||
- main | ||
|
||
jobs: | ||
build: | ||
test_linux: | ||
name: Deploy Docs | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/setup-python@v2 | ||
- uses: actions/checkout@master | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo | ||
- name: Build and Commit | ||
uses: sphinx-notes/pages@v3 | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
submodules: recursive | ||
|
||
- name: Configuring build Environment | ||
run: | | ||
sudo apt-get update | ||
python -m pip install -U pip wheel | ||
- name: Setup Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: sphinx-gh-pages | ||
ruby-version: '3.0' | ||
|
||
- name: Installing dependencies | ||
run: | | ||
python -m pip install -r docs/requirements.txt | ||
gem install jekyll jekyll-remote-theme | ||
- name: Deploying on GitHub Pages | ||
if: github.ref == 'refs/heads/main' | ||
run: | | ||
git remote set-url origin https://x-access-token:${{ secrets.MLC_GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY | ||
git config --global user.email "mlc-gh-actions-bot@nomail" | ||
git config --global user.name "mlc-gh-actions-bot" | ||
./scripts/gh_deploy_site.sh |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
MLC LLM Contributors | ||
==================== | ||
|
||
|
||
## List of Contributors | ||
- [Full List of Contributors](https://github.com/mlc-ai/mlc-llm/graphs/contributors) |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
sphinx-tabs == 3.4.1 | ||
sphinx-gallery == 5.2.3 | ||
sphinx-rtd-theme == 1.1.1 | ||
sphinx-rtd-theme | ||
sphinx == 5.2.3 | ||
sphinx-toolbox == 3.4.0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
set -euxo pipefail | ||
|
||
cd docs && make html && cd .. | ||
|
||
cd site && jekyll b && cd .. | ||
|
||
rm -rf site/_site/docs | ||
cp -r docs/_build/html site/_site/docs |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
# NOTE: this script is triggered by github action automatically | ||
# when megred into main | ||
|
||
set -euxo pipefail | ||
|
||
scripts/build_site.sh | ||
|
||
git fetch | ||
git checkout -B gh-pages origin/gh-pages | ||
rm -rf docs .gitignore | ||
mkdir -p docs | ||
cp -rf site/_site/* docs | ||
touch docs/.nojekyll | ||
|
||
DATE=`date` | ||
git add docs && git commit -am "Build at ${DATE}" | ||
git push origin gh-pages | ||
git checkout main && git submodule update | ||
echo "Finish deployment at ${DATE}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
# NOTE: use this script to check local site | ||
|
||
set -euxo pipefail | ||
|
||
scripts/build_site.sh | ||
|
||
cd site && jekyll serve --skip-initial-build --host localhost --baseurl /mlc-llm --port 8888 |
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