Skip to content

Commit c3889b2

Browse files
committed
Refactor GitHub Actions workflow to streamline the installation and documentation build process. Consolidate Python dependency installation and d2l-book setup into a single step, ensuring the virtual environment is activated beforehand. Update the copying of built HTML documentation to improve clarity and efficiency.
1 parent 9083600 commit c3889b2

File tree

1 file changed

+10
-22
lines changed

1 file changed

+10
-22
lines changed

.github/workflows/update_docs.yml

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -29,44 +29,32 @@ jobs:
2929
restore-keys: |
3030
${{ runner.os }}-pip-
3131
32-
# Install Python dependencies
33-
- name: Install dependencies
34-
run: |
35-
python -m venv venv
36-
source venv/bin/activate
37-
pip install --upgrade pip
38-
pip install -r requirements.txt
39-
pip install sphinx-mathjax-offline
4032
4133
# Install Pandoc using apt-get
4234
- name: Install Pandoc
4335
run: |
4436
sudo apt-get update
4537
sudo apt-get install -y pandoc
46-
47-
# Clone and install the d2l-book repository
48-
- name: Clone and install d2l-book
38+
39+
# Install Python dependencies and build the HTML documentation
40+
- name: Install dependencies
4941
run: |
42+
python -m venv venv
43+
source venv/bin/activate
44+
pip install --upgrade pip
45+
pip install -r requirements.txt
46+
pip install sphinx-mathjax-offline
5047
git clone https://github.com/openmlsys/d2l-book.git
5148
cd d2l-book
5249
pip install .
53-
54-
# Build the HTML documentation
55-
- name: Build HTML Documentation
56-
run: |
57-
source ../venv/bin/activate
50+
cd ..
5851
sh build_html.sh
5952
6053
# Clone the html-en repository
6154
- name: Clone html-en Repository
6255
run: |
63-
cd ..
6456
git clone https://github.com/openmlsys/html-en.git
65-
66-
# Copy the built HTML docs to html-en
67-
- name: Copy Built Docs to html-en
68-
run: |
69-
cp -r d2l-book/_build/html/* html-en/
57+
cp -r _build/html/* html-en/
7058
7159
# Commit and push the updated docs
7260
- name: Commit and Push Changes

0 commit comments

Comments
 (0)