Merge pull request #129 from linjing-lab/main #61
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
name: Polars Guides | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
name: docs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install --no-install-recommends -y graphviz make wget | |
python -m pip install ghp-import | |
sudo wget https://github.com/rust-lang/mdBook/releases/download/v0.4.7/mdbook-v0.4.7-x86_64-unknown-linux-gnu.tar.gz -O - | sudo tar -xzf - -C /usr/bin/ | |
sudo wget https://github.com/ritchie46/mdBook/releases/download/api-0.0.1/mdbook -O /usr/bin/mdbook2 | |
sudo chmod +x /usr/bin/mdbook2 | |
- name: Run snippets | |
run: | | |
make run | |
- name: Deploy docs | |
run: | | |
mkdir -p docs | |
cd user_guide | |
mdbook build --dest-dir ../docs/user-guide . | |
cd .. | |
echo '<meta http-equiv=refresh content=0;url=/polars-book-cn/user-guide/index.html>' > docs/index.html | |
ghp-import --no-jekyll docs | |
git push -qf https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git gh-pages |