-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (55 loc) · 1.88 KB
/
classroom.yml
File metadata and controls
65 lines (55 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# This is a basic workflow to compile and deploy notebook-classroom
name: Notebook-Classrom
# Only run on push to the master branch
on:
push:
branches: [ master ]
schedule:
# change this as you need it: https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule
# runs at 1:30 every saturday
- cron: '30 1 * * 6'
# Jobs to compile notebook classroom
jobs:
# Publish the application on github pages
publish:
# use ubuntu 18.04
runs-on: ubuntu-18.04
steps:
# Checks-out $GITHUB_WORKSPACE
- name: Checkout
uses: actions/checkout@v2
- name: Install Conda
uses: s-weigand/setup-conda@v1.0.2
with:
python-version: 3.6
- name: Install dependencies
run: |
conda env update -f environment.yml -n base
pip install -r ./requirements.txt
# Compile notebooks
- name: Compile Notebooks
run: |
mkdir ./nb
jupyter nbconvert --to html --output-dir='./nb' *.ipynb
jupyter nbconvert --to slides --output-dir='./nb' *ipynb
# install latest notebook classroom app
- name: Install Notebook-classroom
run: |
wget https://github.com/hydrocode-de/notebook-classroom/releases/latest/download/notebook-classroom.zip
unzip ./notebook-classroom.zip -d ./dist
# move all neccessary files
- name: Copy content
run: |
mv ./nb/* ./dist/nb
mv configuration.js ./dist/configuration.js
[ -d ./static ] && mv ./static/* ./dist/static/*
[ -f ./index.md ] && mv index.md ./dist/static/index.md
[ -d ./img ] && mv ./img ./dist/img
# Deploy to Github Pages
- name: Deploy
uses: crazy-max/ghaction-github-pages@v1
with:
target_branch: gh-pages
build_dir: ./dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}