diff --git a/gitlab/functions.sh b/gitlab/functions.sh
index 949626a6c269d6cb3ea0d7c312c108b77da40e21..9ccd6f1f2824b71cac360a960e9de3c279e92f36 100644
--- a/gitlab/functions.sh
+++ b/gitlab/functions.sh
@@ -343,9 +343,12 @@ if [ -z "${CONDA_FOLDER}" ]; then
   CONDA_FOLDER=/opt/miniconda
 fi
 
-# check if a conda installation exists. Otherwise, install one:
+# check if a conda installation exists. Otherwise, install one (only in build
+# stage):
 if [ ! -e ${CONDA_FOLDER}/bin/conda ]; then
-  install_miniconda ${CONDA_FOLDER}
+  if [ "${CI_JOB_STAGE}" == "build" ]; then
+    install_miniconda ${CONDA_FOLDER}
+  fi
 fi
 
 PYVER=py$(echo ${PYTHON_VERSION} | tr -d '.')
diff --git a/templates/gitlab-ci.yml b/templates/gitlab-ci.yml
index 1bfbb4f4a6e16375c30bd965bcb41e4a747d5f0c..edbeeb19c2c0fe2c0c0fa3baf56da23b4f3cc39e 100644
--- a/templates/gitlab-ci.yml
+++ b/templates/gitlab-ci.yml
@@ -17,7 +17,7 @@ stages:
 .build_template: &build_job
   stage: build
   before_script:
-    - export PATH=${CONDA_FOLDER}:$PATH
+    - export PATH=$CONDA_FOLDER:$PATH
     - mkdir _ci
     - curl https://curl.haxx.se/ca/cacert.pem > _ci/cacert.pem
     - export CURL_CA_BUNDLE=`pwd`/_ci/cacert.pem