Skip to content

Commit 47b1448

Browse files
authored
Merge pull request #2 from NeuromatchAcademy/iamzoltan-patch-1
Update publish-book.yaml
2 parents 0508c69 + 7aa7b59 commit 47b1448

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

.github/workflows/publish-book.yaml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ env:
88
NB_KERNEL: python
99
NMA_REPO: course-content-dl
1010
NMA_MAIN_BRANCH: main
11+
CHATIFY: true
12+
SOURCE_REPO: course-content-dl
13+
MOD_REPO: chatify-course-content-dl
1114

1215
# This job installs dependencies, build the book, and pushes it to `gh-pages`
1316
jobs:
@@ -57,6 +60,24 @@ jobs:
5760
rm -r nmaci-$BRANCH
5861
rm -r $BRANCH.tar.gz
5962
echo ci/ >> .gitignore
63+
64+
- name: Install Chatify, Add to Notebooks, Commit Changes
65+
if: env.CHATIFY == 'true'
66+
run: |
67+
pip install -r ci/chatify/requirements.txt
68+
python ci/chatify/process_notebooks.py
69+
git config --local user.email "[email protected]"
70+
git config --local user.name "GitHub Action"
71+
git add '**/student/*.ipynb'
72+
git diff-index --quiet HEAD || git commit -m "Add chatify to student tutorial notebooks"
73+
74+
- name: Push Chatify Changes to Main
75+
if: env.CHATIFY == 'true'
76+
uses: ad-m/[email protected]
77+
with:
78+
github_token: ${{ secrets.GITHUB_TOKEN }}
79+
branch: main
80+
force: false
6081

6182
- name: Install dependencies
6283
run: |
@@ -85,7 +106,7 @@ jobs:
85106
- name: Build the book
86107
run: |
87108
python ci/generate_book_dl.py student
88-
jupyter-book toc migrate /home/runner/work/course-content-dl/course-content-dl/book/_toc.yml -o /home/runner/work/course-content-dl/course-content-dl/book/_toc.yml
109+
jupyter-book toc migrate /home/runner/work/chatify-course-content-dl/chatify-course-content-dl/book/_toc.yml -o /home/runner/work/chatify-course-content-dl/chatify-course-content-dl/book/_toc.yml
89110
ln -s ../tutorials book/tutorials
90111
ln -s ../projects book/projects
91112
ln -s ../prereqs book/prereqs
@@ -96,7 +117,7 @@ jobs:
96117
run: |
97118
git config --local user.email "[email protected]"
98119
git config --local user.name "GitHub Action"
99-
ghp-import -n -c "deeplearning.neuromatch.io" -m "Update course book" book/_build/html
120+
ghp-import -n -c "chatify.deeplearning.neuromatch.io" -m "Update course book" book/_build/html
100121
git checkout -f gh-pages
101122
102123
- name: Publish to gh-pages

0 commit comments

Comments
 (0)