File tree 1 file changed +42
-0
lines changed
1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change
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
+
You can’t perform that action at this time.
0 commit comments