.gitlab-ci.yml 1.27 KB
Newer Older
Konrad Völkel's avatar
Konrad Völkel committed
1
2
3
stages:
  - build
  - deploy
4
5
6
7
8
9
10
11
12

variables:
  PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"

cache:
  paths:
    - .cache/pip
    - venv/

Konrad Völkel's avatar
Konrad Völkel committed
13
jupyter-build-html:
Konrad Völkel's avatar
Konrad Völkel committed
14
  stage: build
Konrad Völkel's avatar
Konrad Völkel committed
15
  image: jupyter/scipy-notebook
Konrad Völkel's avatar
Konrad Völkel committed
16
  script:
Konrad Völkel's avatar
Konrad Völkel committed
17
18
19
20
    - python3 -V  # Print out python version for debugging
    - pip install virtualenv
    - virtualenv venv
    - source venv/bin/activate
Konrad Völkel's avatar
Konrad Völkel committed
21
    - pip install --upgrade pip
Konrad Völkel's avatar
Konrad Völkel committed
22
    - pip install -r requirements.txt -v
Konrad Völkel's avatar
Konrad Völkel committed
23
    - alias python=python3  # for jb clean ...
Konrad Völkel's avatar
Konrad Völkel committed
24
25
26
27
28
29
    - jupyter-book clean .
    - jupyter-book build . --builder html
  artifacts:
    paths:
      - _build/

Konrad Völkel's avatar
Konrad Völkel committed
30
31
32
33
34
35
36
37
38
39
40
41
jupyter-build-pdf:
  stage: build
  image: sphinxdoc/sphinx-latexpdf
  script:
    - python3 -V  # Print out python version for debugging
    - pip install virtualenv
    - virtualenv venv
    - source venv/bin/activate
    - pip install --upgrade pip
    - pip install -r requirements.txt -v
    - alias python=python3  # for jb clean ...
    - jupyter-book clean .
Konrad Völkel's avatar
Konrad Völkel committed
42
43
44
45
    - jupyter-book build . --builder pdflatex --path-output _pdfbuild
  artifacts:
    paths:
      - _pdfbuild/
Konrad Völkel's avatar
Konrad Völkel committed
46

47
48
pages:
  stage: deploy
Konrad Völkel's avatar
Konrad Völkel committed
49
  image: busybox:latest
50
  script:
Konrad Völkel's avatar
Konrad Völkel committed
51
    - mv _build/html public
Konrad Völkel's avatar
Konrad Völkel committed
52
    - mv _pdfbuild/latex/datascience-skript.pdf public/
53
54
  artifacts:
    paths:
Konrad Völkel's avatar
Konrad Völkel committed
55
      - public
56
  rules:
Konrad Völkel's avatar
Konrad Völkel committed
57
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH