Skip to content

Commit bfbdeca

Browse files
authored
Update migrate.yml
1 parent 3f55118 commit bfbdeca

1 file changed

Lines changed: 50 additions & 16 deletions

File tree

.github/workflows/migrate.yml

Lines changed: 50 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,65 @@
1-
# This is a basic workflow to help you get started with Actions
1+
# This is a basic workflow to compile and deploy notebook-classroom
22

3-
name: CI
3+
name: Notebook-Classrom
44

5-
# Controls when the action will run. Triggers the workflow on push or pull request
6-
# events but only for the master branch
5+
# Only run on push to the master branch
76
on: push
7+
# push:
8+
# branches: [ master ]
9+
# schedule:
10+
# # change this as you need it: https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule
11+
# # runs at 1:30 every saturday
12+
# - cron: '30 1 * * 6'
813

9-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
14+
# Jobs to compile notebook classroom
1015
jobs:
11-
# This workflow contains a single job called "build"
12-
build:
13-
# The type of runner that the job will run on
14-
runs-on: ubuntu-latest
16+
# Publish the application on github pages
17+
publish:
18+
# use ubuntu 18.04
19+
runs-on: ubuntu-18.04
1520

16-
# Steps represent a sequence of tasks that will be executed as part of the job
1721
steps:
18-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
19-
- uses: actions/checkout@v2
22+
# Checks-out $GITHUB_WORKSPACE
23+
- name: Checkout
24+
uses: actions/checkout@v2
2025

21-
# Runs a single command using the runners shell
2226
- name: Install Conda
2327
uses: s-weigand/setup-conda@v1.0.2
2428
with:
2529
python-version: 3.6
2630

27-
- name: install deps
31+
- name: Install dependencies
2832
run: |
2933
conda env update -f environment.yml -n base
30-
jupyter nbconvert --to html *.ipynb
31-
ls
34+
pip install -r ./requirements.txt
35+
36+
# Compile notebooks
37+
- name: Compile Notebooks
38+
run: |
39+
mkdir ./nb
40+
jupyter nbconvert --to html --output-dir='./nb' *.ipynb
41+
jupyter nbconvert --to slides --output-dir='./nb' *ipynb
42+
43+
# install latest notebook classroom app
44+
- name: Install Notebook-classroom
45+
run: |
46+
wget https://github.com/hydrocode-de/notebook-classroom/releases/latest/download/notebook-classroom.zip
47+
unzip ./notebook-classroom.zip -d ./dist
48+
49+
# move all neccessary files
50+
- name: Copy content
51+
run: |
52+
mv ./nb/* ./dist/nb
53+
mv configuration.js ./dist/configuration.js
54+
[ -d ./static ] && mv ./static/* ./dist/static/*
55+
[ -f ./index.md ] && mv index.md ./dist/static/index.md
56+
[ -d ./img ] && mv ./img ./dist/img
57+
58+
# Deploy to Github Pages
59+
# - name: Deploy
60+
# uses: crazy-max/ghaction-github-pages@v1
61+
# with:
62+
# target_branch: gh-pages
63+
# build_dir: ./dist
64+
# env:
65+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)