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 18, 2024
1 parent 4637ada commit 92d368d
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions .github/workflows/publish-book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ env:
NB_KERNEL: python
NMA_REPO: course-content
NMA_MAIN_BRANCH: main

CHATIFY: true
SOURCE_REPO: course-content
MOD_REPO: chatify-course-content

# This job installs dependencies, build the book, and pushes it to `gh-pages`
jobs:
build-and-deploy-book:
Expand Down Expand Up @@ -43,6 +46,24 @@ jobs:
rm -r $BRANCH.tar.gz
echo ci/ >> .gitignore
- 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
if: env.CHATIFY == 'true'
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
force: false

- name: Install dependencies
run: |
pip install -r requirements.txt
Expand Down Expand Up @@ -74,7 +95,7 @@ jobs:
- name: Build student book
run: |
python ci/generate_book.py student
jupyter-book toc migrate /home/runner/work/course-content/course-content/book/_toc.yml -o /home/runner/work/course-content/course-content/book/_toc.yml
jupyter-book toc migrate /home/runner/work/chatify-course-content/chatify-course-content/book/_toc.yml -o /home/runner/work/chatify-course-content/chatify-course-content/book/_toc.yml
ln -s ../tutorials book/tutorials
ln -s ../projects book/projects
ln -s ../prereqs book/prereqs
Expand All @@ -85,7 +106,7 @@ jobs:
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
ghp-import -n -c "compneuro.neuromatch.io" -m "Update course book" book/_build/html
ghp-import -n -c "chatify.compneuro.neuromatch.io" -m "Update course book" book/_build/html
git checkout -f gh-pages
- name: Publish to gh-pages
Expand Down

0 comments on commit 92d368d

Please sign in to comment.