Skip to content

Instantly share code, notes, and snippets.

@betatim
Created April 4, 2019 05:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save betatim/0a31ea563289afa2ce077d99a64b0948 to your computer and use it in GitHub Desktop.
Save betatim/0a31ea563289afa2ce077d99a64b0948 to your computer and use it in GitHub Desktop.
CircleCI config to run notebooks, convert to HTML and upload them somewhere.
version: 2.1
jobs:
grade:
docker:
- image: continuumio/miniconda3:4.5.11
working_directory: /tmp/repo
steps:
- checkout
- run:
name: Install grading dependencies
command: |
source activate base
pip install --progress-bar off ipython ipywidgets
pip install --progress-bar off https://github.com/nteract/papermill/archive/master.zip
- run:
name: Install course specific dependencies
command: |
source activate base
[ -e environment.yml ] && conda env update --quiet -f environment.yml && conda clean -tipsy || echo nothing to do
- run:
name: "Prepare output directories"
command: |
mkdir -p notebooks/week1
mkdir -p notebooks/week3
- run:
name: Execute week1/homework.ipynb
command: |
source activate base
papermill --cwd week1 week1/homework.ipynb homework-graded.ipynb
jupyter nbconvert --to html --stdout week1/homework-graded.ipynb > notebooks/week1/homework.html
- run:
name: Execute week3/homework.ipynb
command: |
source activate base
papermill --cwd week3 week3/homework.ipynb homework-graded.ipynb
jupyter nbconvert --to html --stdout week3/homework-graded.ipynb > notebooks/week3/homework.html
- store_artifacts:
path: /tmp/repo/notebooks
destination: notebooks
workflows:
version: 2
grade_me:
jobs:
- grade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment