diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 71a1abe..6e523a7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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/