From 105d30f4a997882e810a83aa514df1528c674fc5 Mon Sep 17 00:00:00 2001 From: Caspar Jungbacker Date: Wed, 19 Apr 2023 12:53:32 +0200 Subject: [PATCH] Update .gitlab-ci.yml - Add testing job for main (same as build job for publish, but without artifacts) - Deploy job now only is triggered when something is pushed to publish --- .gitlab-ci.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8717c55..7fffe30 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,7 @@ image: python:3.10-bullseye stages: + - test - build - deploy @@ -12,16 +13,28 @@ cache: - .cache/pip - venv/ +# Before running other jobs, setup Python before_script: - python -V - pip install virtualenv - virtualenv venv - source venv/bin/activate +# This job tests if the book compiles gracefully after a new addition +test-build: + stage: test + only: + - main + script: + - pip install -r requirements.txt + - jupyter-book clean book/ + - jupyter-book build book/ + +# This job builds the HTML when it gets pushed to the publish branch build-book: stage: build only: - - main + - publish script: - pip install -r requirements.txt - jupyter-book clean book/ @@ -30,10 +43,11 @@ build-book: paths: - book/_build/html/ +# This job commits the built HTML to the publish-html branch push-html: stage: deploy only: - - main + - publish before_script: - apt-get update -y - apt-get install rsync -y