Skip to content

Commit

Permalink
refactor: remove openmlsys-en here.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chivier committed Jan 27, 2025
1 parent 493e8e1 commit 5b1b3e2
Show file tree
Hide file tree
Showing 558 changed files with 5,003 additions and 54,603 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/.main.yml.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: D2l Test

on:
- push
- pull_request
- workflow_dispatch # Allows you to run this workflow manually from the Actions tab

jobs:
build:
runs-on: ubuntu-20.04

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: '3.8'

- name: Cache Python packages
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install dependencies
run: |
python -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
cd ..
git clone https://github.com/openmlsys/d2l-book.git
cd d2l-book
pip install .

- name: Install pandoc
run: |
sudo apt-get update
sudo apt-get install -y pandoc

- name: Build HTML documentation
run: |
source venv/bin/activate
d2lbook build html
97 changes: 97 additions & 0 deletions .github/workflows/update_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Update Docs

on:
push:
pull_request:
workflow_dispatch:

env:
PYTHON_VERSION: '3.8'
GIT_USER_NAME: 'GitHub Actions Bot'
GIT_USER_EMAIL: 'github-actions[bot]@users.noreply.github.com'

jobs:
build-and-deploy:
runs-on: ubuntu-20.04

steps:
- name: Checkout repository
uses: actions/checkout@v3 # Updated to v3
with:
fetch-depth: 0 # Fetch all history for better versioning

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip' # Enable pip caching

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y pandoc
- name: Setup Python virtual environment
run: |
python -m venv venv
source venv/bin/activate
pip install --upgrade pip
- name: Install Python dependencies
run: |
source venv/bin/activate
pip install -r requirements.txt
pip install sphinx-mathjax-offline
- name: Install d2l-book
run: |
source venv/bin/activate
git clone https://github.com/openmlsys/d2l-book.git
cd d2l-book
pip install .
cd ..
- name: Build documentation
run: |
source venv/bin/activate
sh build_html.sh
- name: Deploy to pages branch
run: |
# Create and switch to a new worktree for the pages branch
git worktree add --detach pages
cd pages
# Delete pages branch if it exists and create a new orphan branch
git fetch origin pages || true
git branch -D pages || true
git checkout --orphan pages
git rm -rf . || true
# Copy built documentation
cp -r ../_build/html/* .
# Configure git
git config user.name "${GIT_USER_NAME}"
git config user.email "${GIT_USER_EMAIL}"
# Add and commit all changes
git add .
git commit -m "docs: update documentation
Automated update by GitHub Actions
Workflow: ${{ github.workflow }}
Run ID: ${{ github.run_id }}
Triggered by: ${{ github.event_name }}"
# Force push to pages branch
git push -f origin pages
# Clean up the worktree
cd ..
git worktree remove pages
- name: Clean up
if: always()
run: |
rm -rf venv
rm -rf d2l-book
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# openmlsys-en
《Machine Learning Systems: Design and Implementation》- English Version
5 changes: 0 additions & 5 deletions _sources/chapter_preface/index.rst.txt

This file was deleted.

14 changes: 0 additions & 14 deletions _sources/index.rst.txt

This file was deleted.

3 changes: 0 additions & 3 deletions _sources/static/readme.rst.txt

This file was deleted.

134 changes: 0 additions & 134 deletions _static/_sphinx_javascript_frameworks_compat.js

This file was deleted.

Loading

0 comments on commit 5b1b3e2

Please sign in to comment.