Files
sglang/.github/workflows/deploy-docs.yml
Chayenne 51c81e339b Add openAI compatible API (#1810)
Co-authored-by: Chayenne <zhaochenyang@g.ucla.edu>
2024-10-27 10:51:42 -07:00

70 lines
1.9 KiB
YAML

name: Release Documentation
on:
push:
branches:
- main
paths:
- 'docs/**'
- 'python/sglang/version.py'
workflow_dispatch:
jobs:
execute-and-deploy:
runs-on: 1-gpu-runner
if: github.repository == 'sgl-project/sglang'
defaults:
run:
working-directory: docs
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
path: .
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install dependencies
run: |
bash scripts/ci_install_dependency.sh
pip install -r requirements.txt
apt-get update
apt-get install -y pandoc
- name: Setup Jupyter Kernel
run: |
python -m ipykernel install --user --name python3 --display-name "Python 3"
- name: Execute notebooks
run: |
for nb in *.ipynb; do
if [ -f "$nb" ]; then
echo "Executing $nb"
jupyter nbconvert --to notebook --execute --inplace "$nb" \
--ExecutePreprocessor.timeout=600 \
--ExecutePreprocessor.kernel_name=python3
fi
done
- name: Build documentation
run: |
make html
- name: Push to sgl-project.github.io
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
run: |
cd _build/html
git clone https://$GITHUB_TOKEN@github.com/sgl-project/sgl-project.github.io.git ../sgl-project.github.io
cp -r * ../sgl-project.github.io
cd ../sgl-project.github.io
git config user.name "zhaochenyang20"
git config user.email "zhaochenyang20@gmail.com"
git add .
git commit -m "Update $(date +'%Y-%m-%d %H:%M:%S')"
git push https://$GITHUB_TOKEN@github.com/sgl-project/sgl-project.github.io.git main
cd ..
rm -rf sgl-project.github.io