Skip to content

Commit c5836fc

Browse files
committed
first attempt at the github action. flood gates will open after MJL finishes his copy
1 parent d0199d8 commit c5836fc

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/demos.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Demos
2+
3+
on:
4+
push:
5+
branches-ignore: [main]
6+
paths:
7+
- "examples/use_cases/**/*.ipynb"
8+
9+
jobs:
10+
copy-docs:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
16+
- name: "Copy demo notebooks to top level demos folder"
17+
run: cp -R examples/use_cases/* demos/
18+
19+
- name: "Regex out the NBVAL_SKIP and NBVAL_IGNORE_OUTPUT comments"
20+
run: |
21+
cd demos/
22+
find ./ -type f -name "*.ipynb" -exec sed -i '.bak' 's/\#\ NBVAL_SKIP//g' {} \;
23+
find ./ -type f -name "*.ipynb" -exec sed -i '.bak' 's/\#\ NBVAL_IGNORE_OUTPUT//g' {} \;
24+
25+
- name: "Regex out the is_demo option and tag as demo"
26+
run: |
27+
cd demos/
28+
find ./ -type f -name "*.ipynb" -exec sed -i '.bak' 's/lineapy.options.set(\\"is_demo\\",\ True)/lineapy.tag(\\"Demo\\")/g' {} \;
29+
30+
- name: Commit files
31+
run: |
32+
git config --local user.email "[email protected]"
33+
git config --local user.name "Humble bot servant"
34+
git add .
35+
(git diff --quiet && git diff --staged --quiet) || git commit -m "Add tutorials to docs"
36+
- name: push doc changes
37+
uses: ad-m/github-push-action@master
38+
with:
39+
github_token: ${{ secrets.GITHUB_TOKEN }}
40+
branch: ${{ github.ref }}
41+
42+

0 commit comments

Comments
 (0)