From f4d20d6d89a904501510ac9e82547328b97aa196 Mon Sep 17 00:00:00 2001 From: Edwin Vargas Navarro Date: Tue, 2 Dec 2025 12:50:43 -0800 Subject: [PATCH 1/5] feat(jbv2 branch): upgrade testing --- .github/workflows/deploy.yml | 15 +++--- .github/workflows/test-build.yml | 39 ++++++++++++++ modules/myst.yml | 90 ++++++++++++++++++++++++++++++++ requirements.txt | 11 ++-- 4 files changed, 141 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/test-build.yml create mode 100644 modules/myst.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b9764dc..c6e639d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,6 +3,7 @@ name: Build & deploy Jupyter Book on: push: branches: [main] + workflow_dispatch: # Allows manual trigger from GitHub UI permissions: contents: read @@ -21,21 +22,23 @@ jobs: - uses: actions/setup-python@v5 with: - python-version: '3.13' + python-version: '3.12' - name: Install deps run: | - pip install -U jupyter-book - # optional: project-specific deps - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + pip install -r requirements.txt + # Install modules-specific dependencies if they exist + if [ -f modules/requirements.txt ]; then pip install -r modules/requirements.txt; fi - name: Build the book - run: jupyter-book build modules --path-output _site + run: | + cd modules + jupyter book build --html . - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: - path: ./_site/_build/html/ + path: ./modules/_build/html deploy: needs: build diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml new file mode 100644 index 0000000..71d4e89 --- /dev/null +++ b/.github/workflows/test-build.yml @@ -0,0 +1,39 @@ +name: Test Build (PRs) + +# This workflow only builds the book to verify it works, but doesn't deploy +# Useful for testing changes in pull requests + +on: + pull_request: + branches: [main] + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install deps + run: | + pip install -r requirements.txt + # Install modules-specific dependencies if they exist + if [ -f modules/requirements.txt ]; then pip install -r modules/requirements.txt; fi + + - name: Build the book + run: | + cd modules + jupyter book build --html . + + - name: Upload artifact (for inspection) + uses: actions/upload-pages-artifact@v3 + with: + path: './modules/_build/html' + retention-days: 1 # Keep artifact for 1 day only + diff --git a/modules/myst.yml b/modules/myst.yml new file mode 100644 index 0000000..4e5984f --- /dev/null +++ b/modules/myst.yml @@ -0,0 +1,90 @@ +version: 1 + +project: + title: El Camino College Showcase + authors: + - name: Jonathan Ferrari + - name: Edwin Vargas Navarro + github: ds-modules/ecc-textbook + bibliography: + - references.bib + jupyter: true + execute: + execute_notebooks: 'off' + exports: + - format: pdf + template: plain_latex_book + output: exports/book.pdf + toc: + - file: intro.md + - title: Biology + children: + - file: ecc-biology/Cancer_Mutations/cancer_mutations.md + - file: ecc-biology/Introduction/introduction.md + - file: ecc-biology/enzymes/enzymes_bioinformatics.md + - file: ecc-biology/polarity/bond_polarity.md + - title: Business + children: + - file: ecc-business/marketing-fast-food/marketing_case_study.md + - file: ecc-business/sba/sba.md + - title: Calculus + children: + - file: ecc-calculus/partial_fractions_lesson.md + - file: ecc-calculus/pfd.md + - file: ecc-calculus/riemann_sum.md + - file: ecc-calculus/sums.md + - title: Chemistry + children: + - file: ecc-chemistry/Orbitals.md + - title: Child Development + children: + - file: ecc-child-development/parental-risk.md + - title: CS 9 + children: + - file: ecc-cs9/ECC CalEnviroScreen.md + - file: ecc-cs9/Modeling_CA_Housing_lab.md + - file: ecc-cs9/ces/nb-archive/CES1-intro.md + - file: ecc-cs9/ces/nb-archive/CES2-CommColl.md + - file: ecc-cs9/ces/nb-archive/CES_Mapping.md + - file: ecc-cs9/ces/proj1/proj1.md + - file: ecc-cs9/ces/proj2.md + - file: ecc-cs9/policing/policing.md + - title: Ethnic Studies + children: + - file: ecc-ethnic-studies/Incarceration/Incarcerations.md + - file: ecc-ethnic-studies/Incarceration/otter.md + - file: ecc-ethnic-studies/introduction/introduction.md + - file: ecc-ethnic-studies/race-and-health/Health.md + - title: Sociology + children: + - file: ecc-sociology/Incarcerations/Incarcerations.md + - file: ecc-sociology/environment/environmental-justice.md + - file: ecc-sociology/introduction/introduction.md + - file: ecc-sociology/race-and-health/Health.md + - title: Statistics + children: + - file: ecc-statistics/anova/anova.md + - file: ecc-statistics/data_representation/Data-Rep-Module.md + - file: ecc-statistics/probability_distribution/Probability-Distributions.md + - file: ecc-statistics/sampling_distribution/sampling_distribution.md + +site: + template: book-theme + nav: + - title: Home + url: / + actions: + - title: Open Issue + url: https://github.com/ds-modules/ecc-textbook/issues/new + options: + logo: _static/ds.svg + favicon: _static/favicon.ico + logo_text: El Camino College Showcase + extra_css: + - _static/custom.css + navigation_with_keys: true + show_toc_level: 2 + show_navbar_depth: 2 + use_issues_button: true + use_repository_button: true + diff --git a/requirements.txt b/requirements.txt index 6474fda..08b051c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,3 @@ -jupyter-book==1.0.3 -quantecon-book-theme==0.8.3 -sphinx-tojupyter==0.3.0 -sphinxext-rediraffe==0.2.7 -sphinx-exercise==1.0.1 -ghp-import==2.1.0 -sphinxcontrib-youtube==1.3.0 -sphinx-togglebutton==0.3.2 \ No newline at end of file +jupyter-book==2.0.2 +mystmd +ghp-import==2.1.0 \ No newline at end of file From 566e46a31aec522845732ae360f1cce226c16327 Mon Sep 17 00:00:00 2001 From: Edwin Vargas Navarro Date: Tue, 2 Dec 2025 12:55:32 -0800 Subject: [PATCH 2/5] test 2 --- .github/workflows/deploy.yml | 24 +++++++++++++++++++- .github/workflows/test-build.yml | 39 ++++++++++++++++++++++++++++++-- 2 files changed, 60 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c6e639d..a35c2d4 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -33,7 +33,29 @@ jobs: - name: Build the book run: | cd modules - jupyter book build --html . + set -e # Exit on error + echo "--- Building Jupyter Book ---" + jupyter book build --html . || { + echo "Build failed, checking for alternative command..." + jupyter-book build --html . || exit 1 + } + echo "--- Checking build output ---" + ls -la _build/ 2>/dev/null || echo "No _build directory found" + if [ -d "_build/html" ]; then + echo "✓ Found _build/html directory" + ls -la _build/html/ | head -10 + elif [ -d "_build/site" ]; then + echo "✓ Found _build/site directory (JB 2.0 format)" + ls -la _build/site/ | head -10 + # Copy site to html for compatibility + cp -r _build/site _build/html + echo "Copied _build/site to _build/html" + else + echo "ERROR: No build output found in _build/html or _build/site!" + echo "Contents of _build:" + ls -la _build/ || echo "No _build directory" + exit 1 + fi - name: Upload artifact uses: actions/upload-pages-artifact@v3 diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 71d4e89..d5df5d9 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -29,11 +29,46 @@ jobs: - name: Build the book run: | cd modules - jupyter book build --html . + set -e # Exit on error + echo "--- Building Jupyter Book ---" + jupyter book build --html . || { + echo "Build failed, checking for alternative command..." + jupyter-book build --html . || exit 1 + } + echo "--- Checking build output ---" + ls -la _build/ 2>/dev/null || echo "No _build directory found" + find _build -type f -name "*.html" 2>/dev/null | head -10 || echo "No HTML files found" + if [ -d "_build/html" ]; then + echo "✓ Found _build/html directory" + ls -la _build/html/ | head -10 + elif [ -d "_build/site" ]; then + echo "✓ Found _build/site directory (JB 2.0 format)" + ls -la _build/site/ | head -10 + else + echo "ERROR: No build output found in _build/html or _build/site!" + echo "Contents of _build:" + ls -la _build/ || echo "No _build directory" + exit 1 + fi + + - name: Determine build output path + id: build_path + run: | + cd modules + if [ -d "_build/html" ]; then + echo "path=./modules/_build/html" >> $GITHUB_OUTPUT + echo "Found _build/html" + elif [ -d "_build/site" ]; then + echo "path=./modules/_build/site" >> $GITHUB_OUTPUT + echo "Found _build/site" + else + echo "ERROR: No build output directory found!" + exit 1 + fi - name: Upload artifact (for inspection) uses: actions/upload-pages-artifact@v3 with: - path: './modules/_build/html' + path: ${{ steps.build_path.outputs.path }} retention-days: 1 # Keep artifact for 1 day only From 58378e807f045982e7efe5ca71e2a9aee419ce12 Mon Sep 17 00:00:00 2001 From: Edwin Vargas Navarro Date: Tue, 2 Dec 2025 12:58:20 -0800 Subject: [PATCH 3/5] test3 --- .github/workflows/deploy.yml | 10 +++++++--- .github/workflows/test-build.yml | 10 +++++++--- modules/myst.yml | 3 --- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a35c2d4..88ff704 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -35,9 +35,13 @@ jobs: cd modules set -e # Exit on error echo "--- Building Jupyter Book ---" - jupyter book build --html . || { - echo "Build failed, checking for alternative command..." - jupyter-book build --html . || exit 1 + # Try JB 2.0 site build command (without --html flag) + jupyter book build . || { + echo "Build failed, trying with --html flag..." + jupyter book build --html . || { + echo "Build failed, checking for alternative command..." + jupyter-book build . || exit 1 + } } echo "--- Checking build output ---" ls -la _build/ 2>/dev/null || echo "No _build directory found" diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index d5df5d9..25e4b71 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -31,9 +31,13 @@ jobs: cd modules set -e # Exit on error echo "--- Building Jupyter Book ---" - jupyter book build --html . || { - echo "Build failed, checking for alternative command..." - jupyter-book build --html . || exit 1 + # Try JB 2.0 site build command (without --html flag) + jupyter book build . || { + echo "Build failed, trying with --html flag..." + jupyter book build --html . || { + echo "Build failed, checking for alternative command..." + jupyter-book build . || exit 1 + } } echo "--- Checking build output ---" ls -la _build/ 2>/dev/null || echo "No _build directory found" diff --git a/modules/myst.yml b/modules/myst.yml index 4e5984f..2d57f5b 100644 --- a/modules/myst.yml +++ b/modules/myst.yml @@ -70,9 +70,6 @@ project: site: template: book-theme - nav: - - title: Home - url: / actions: - title: Open Issue url: https://github.com/ds-modules/ecc-textbook/issues/new From a89aa7233fcf9932cc9e58a9e9eec9ba26bc5fb9 Mon Sep 17 00:00:00 2001 From: Edwin Vargas Navarro Date: Tue, 2 Dec 2025 13:00:16 -0800 Subject: [PATCH 4/5] test 4 --- .github/workflows/deploy.yml | 10 +++------- .github/workflows/test-build.yml | 10 +++------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 88ff704..ca4ae2b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -35,13 +35,9 @@ jobs: cd modules set -e # Exit on error echo "--- Building Jupyter Book ---" - # Try JB 2.0 site build command (without --html flag) - jupyter book build . || { - echo "Build failed, trying with --html flag..." - jupyter book build --html . || { - echo "Build failed, checking for alternative command..." - jupyter-book build . || exit 1 - } + jupyter book build --html || { + echo "Build failed, checking for alternative command..." + jupyter-book build --html || exit 1 } echo "--- Checking build output ---" ls -la _build/ 2>/dev/null || echo "No _build directory found" diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 25e4b71..71b0f19 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -31,13 +31,9 @@ jobs: cd modules set -e # Exit on error echo "--- Building Jupyter Book ---" - # Try JB 2.0 site build command (without --html flag) - jupyter book build . || { - echo "Build failed, trying with --html flag..." - jupyter book build --html . || { - echo "Build failed, checking for alternative command..." - jupyter-book build . || exit 1 - } + jupyter book build --html || { + echo "Build failed, checking for alternative command..." + jupyter-book build --html || exit 1 } echo "--- Checking build output ---" ls -la _build/ 2>/dev/null || echo "No _build directory found" From 12c2f68f68503859579d8c56449e23702589b632 Mon Sep 17 00:00:00 2001 From: Edwin Vargas Navarro Date: Tue, 2 Dec 2025 13:11:12 -0800 Subject: [PATCH 5/5] feat(github action): jbv2 simplification --- .github/workflows/deploy.yml | 26 +++----------------------- .github/workflows/test-build.yml | 28 +++------------------------- 2 files changed, 6 insertions(+), 48 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ca4ae2b..ba66d6c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -33,29 +33,9 @@ jobs: - name: Build the book run: | cd modules - set -e # Exit on error - echo "--- Building Jupyter Book ---" - jupyter book build --html || { - echo "Build failed, checking for alternative command..." - jupyter-book build --html || exit 1 - } - echo "--- Checking build output ---" - ls -la _build/ 2>/dev/null || echo "No _build directory found" - if [ -d "_build/html" ]; then - echo "✓ Found _build/html directory" - ls -la _build/html/ | head -10 - elif [ -d "_build/site" ]; then - echo "✓ Found _build/site directory (JB 2.0 format)" - ls -la _build/site/ | head -10 - # Copy site to html for compatibility - cp -r _build/site _build/html - echo "Copied _build/site to _build/html" - else - echo "ERROR: No build output found in _build/html or _build/site!" - echo "Contents of _build:" - ls -la _build/ || echo "No _build directory" - exit 1 - fi + set -e + jupyter book build --html || jupyter-book build --html + [ -d "_build/site" ] && cp -r _build/site _build/html || [ -d "_build/html" ] - name: Upload artifact uses: actions/upload-pages-artifact@v3 diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 71b0f19..5cdaba9 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -29,27 +29,8 @@ jobs: - name: Build the book run: | cd modules - set -e # Exit on error - echo "--- Building Jupyter Book ---" - jupyter book build --html || { - echo "Build failed, checking for alternative command..." - jupyter-book build --html || exit 1 - } - echo "--- Checking build output ---" - ls -la _build/ 2>/dev/null || echo "No _build directory found" - find _build -type f -name "*.html" 2>/dev/null | head -10 || echo "No HTML files found" - if [ -d "_build/html" ]; then - echo "✓ Found _build/html directory" - ls -la _build/html/ | head -10 - elif [ -d "_build/site" ]; then - echo "✓ Found _build/site directory (JB 2.0 format)" - ls -la _build/site/ | head -10 - else - echo "ERROR: No build output found in _build/html or _build/site!" - echo "Contents of _build:" - ls -la _build/ || echo "No _build directory" - exit 1 - fi + set -e + jupyter book build --html || jupyter-book build --html - name: Determine build output path id: build_path @@ -57,13 +38,10 @@ jobs: cd modules if [ -d "_build/html" ]; then echo "path=./modules/_build/html" >> $GITHUB_OUTPUT - echo "Found _build/html" elif [ -d "_build/site" ]; then echo "path=./modules/_build/site" >> $GITHUB_OUTPUT - echo "Found _build/site" else - echo "ERROR: No build output directory found!" - exit 1 + echo "ERROR: No build output found" && exit 1 fi - name: Upload artifact (for inspection)