Skip to content

Commit

Permalink
Update publish-book.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
iamzoltan authored Jul 17, 2024
1 parent d32a6ca commit f738d8a
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/publish-book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ env:
NMA_REPO: climate-course-content
NMA_MAIN_BRANCH: main
PREREQ_INTRO: ClimateScience
CHATIFY: true
SOURCE_REPO: climate-course-content
MOD_REPO: chatify-climate-course-content

ORG: neuromatch

Expand All @@ -35,6 +38,23 @@ jobs:
with:
force_env_update: 'false'

- name: Install Chatify, Add to Notebooks, Commit Changes
if: env.CHATIFY == 'true'
run: |
pip install -r ci/chatify/requirements.txt
python ci/chatify/process_notebooks.py
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add '**/student/*.ipynb'
git diff-index --quiet HEAD || git commit -m "Add chatify to student tutorial notebooks"
- name: Push Chatify Changes to Main
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
force: false

# Cache not currently working. May conflict with Cache in setup
# Unsure if the cache in setup works properly either
# - name: Cache Jupyter Build Artifacts
Expand All @@ -52,7 +72,7 @@ jobs:
# TODO: get this working with a general CI
# python ci/generate_book_climate.py student
python ci/generate_book.py student
jupyter-book toc migrate /home/runner/work/climate-course-content/climate-course-content/book/_toc.yml -o /home/runner/work/climate-course-content/climate-course-content/book/_toc.yml
jupyter-book toc migrate /home/runner/work/chatify-climate-course-content/chatify-climate-course-content/book/_toc.yml -o /home/runner/work/chatify-climate-course-content/chatify-climate-course-content/book/_toc.yml
ln -s ../tutorials book/tutorials
ln -s ../projects book/projects
# ln -s ../prereqs book/prereqs
Expand All @@ -65,7 +85,7 @@ jobs:
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
ghp-import -n -c "comptools.climatematch.io" -m "Update course book" book/_build/html
ghp-import -n -c "chatify.comptools.climatematch.io" -m "Update course book" book/_build/html
git checkout -f gh-pages
- name: Publish to gh-pages
Expand Down

0 comments on commit f738d8a

Please sign in to comment.