33name : Notebook-Classrom
44
55# Only run on push to the master branch
6- on :
6+ on :
77 push :
88 branches : [ master ]
99 schedule :
1515jobs :
1616 # Publish the application on github pages
1717 publish :
18- # use ubuntu
18+ # use ubuntu 18.04
1919 runs-on : ubuntu-18.04
2020
2121 steps :
2222 # Checks-out $GITHUB_WORKSPACE
2323 - name : Checkout
2424 uses : actions/checkout@v2
25-
26- - name : Setup Python 3.6
27- uses : actions /setup-python @v1
25+
26+ - name : Install Conda
27+ uses : s-weigand /setup-conda @v1.0.2
2828 with :
2929 python-version : 3.6
30-
31- # install requirements
32- - name : Install requirements
30+
31+ - name : Install dependencies
3332 run : |
34- python -m pip install --upgrade pip
33+ conda env update -f environment.yml -n base
3534 pip install -r ./requirements.txt
3635
3736 # Compile notebooks
@@ -40,26 +39,27 @@ jobs:
4039 mkdir ./nb
4140 jupyter nbconvert --to html --output-dir='./nb' *.ipynb
4241 jupyter nbconvert --to slides --output-dir='./nb' *ipynb
43-
42+
4443 # install latest notebook classroom app
4544 - name : Install Notebook-classroom
4645 run : |
4746 wget https://github.com/hydrocode-de/notebook-classroom/releases/latest/download/notebook-classroom.zip
4847 unzip ./notebook-classroom.zip -d ./dist
49-
50- # move all neccessary files
48+
49+ # move all neccessary files
5150 - name : Copy content
5251 run : |
5352 mv ./nb/* ./dist/nb
5453 mv configuration.js ./dist/configuration.js
5554 [ -d ./static ] && mv ./static/* ./dist/static/*
5655 [ -f ./index.md ] && mv index.md ./dist/static/index.md
5756 [ -d ./img ] && mv ./img ./dist/img
58-
57+
58+ # Deploy to Github Pages
5959 - name : Deploy
6060 uses : crazy-max/ghaction-github-pages@v1
6161 with :
6262 target_branch : gh-pages
6363 build_dir : ./dist
6464 env :
65- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
65+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments