Dev #30
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: Update Docs | |
on: | |
- push | |
- pull_request | |
- workflow_dispatch | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
# Checkout the repository | |
- uses: actions/checkout@v2 | |
# Set up Python 3.8 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.8' | |
# Install Pandoc | |
- run: | | |
sudo apt-get update | |
sudo apt-get install -y pandoc | |
# Install dependencies and build docs | |
- run: | | |
python -m venv venv | |
source venv/bin/activate | |
pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install sphinx-mathjax-offline | |
git clone https://github.com/openmlsys/d2l-book.git | |
cd d2l-book | |
pip install . | |
cd .. | |
sh build_html.sh | |
# Clone html-en and push updates with PAT auth | |
- run: cd .. | |
- run: | | |
git clone https://github.com/openmlsys/html-en.git | |
- run: cp -r _build/html/* html-en/ | |
- run: | | |
cd html-en | |
# Authenticate with PAT before pushing | |
git remote set-url origin https://x-access-token:${{ secrets.GH_TOKEN }}@github.com/openmlsys/html-en.git | |
git add . | |
git config user.name "Chivier" | |
git config user.email "[email protected]" | |
git commit -m 'update docs' | |
git push origin main |