mirror of
https://github.com/TeachBooks/manual.git
synced 2026-11-13 14:55:51 +00:00
47 lines
941 B
YAML
47 lines
941 B
YAML
image: python:3.10-bullseye
|
|
|
|
stages:
|
|
- build
|
|
- deploy
|
|
|
|
variables:
|
|
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
|
|
|
|
cache:
|
|
paths:
|
|
- .cache/pip
|
|
- venv/
|
|
- archive/_build
|
|
|
|
before_script:
|
|
- python -V
|
|
- pip install virtualenv
|
|
- virtualenv venv
|
|
- source venv/bin/activate
|
|
|
|
jupyter-build:
|
|
stage: build
|
|
only:
|
|
- main
|
|
script:
|
|
- pip install -r requirements.txt
|
|
- jupyter-book build book/
|
|
artifacts:
|
|
paths:
|
|
- book/_build/html/
|
|
|
|
push-html:
|
|
stage: deploy
|
|
only:
|
|
- main
|
|
before_script:
|
|
- apt-get update -y
|
|
- apt-get install rsync -y
|
|
- git remote add origin https://gitlab-ci-token:$ACCESS_TOKEN@gitlab.tudelft.nl/$CI_PROJECT_PATH.git
|
|
- git fetch origin publish-html
|
|
- git checkout publish-html
|
|
script:
|
|
- rsync -av --delete book/_build/html/* ./.
|
|
- git add --all -- ':!book/*' ':!.cache/*'
|
|
- git commit -m "$CI_COMMIT_MESSAGE"
|
|
- git push origin publish-html
|