Move before_script

This commit is contained in:
Caspar Jungbacker 2023-06-26 18:06:09 +02:00
parent ba12b0c3f7
commit e04e274eee

View file

@ -15,22 +15,19 @@ cache:
paths:
- .cache/pip
# Before running other jobs, setup the Anaconda environment
before_script:
- python -V
- conda env create -f environment.yml
- conda init bash
- source ~/.bashrc
- conda activate jupyter-book-env
# This job tests if the book compiles gracefully after a new addition
test-build:
stage: test
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH == "main" && $CI_PIPELINE_SOURCE == "push"
before_script:
- python -V
- conda env create -f environment.yml
- conda init bash
- source ~/.bashrc
- conda activate jupyter-book-env
script:
- pip install -r requirements.txt
- jupyter-book clean book/
- jupyter-book build book/
@ -38,6 +35,12 @@ build-book:
stage: build
rules:
- if: $CI_COMMIT_BRANCH == "publish" && $CI_PIPELINE_SOURCE == "push"
before_script:
- python -V
- conda env create -f environment.yml
- conda init bash
- source ~/.bashrc
- conda activate jupyter-book-env
script:
- jupyter-book clean book/
- jupyter-book build book/