diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a1886d771b213e1b7f95eecb665cc39e829442c3..959356d9fbad12984c5a825ca2febf0da49341eb 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -169,10 +169,8 @@ build-spack-env-on-runner:
     SPACK_DEV_PATH: $CI_PROJECT_DIR/spack
     SPACK_USER_CACHE_PATH: $CI_PROJECT_DIR/.spack
     SPACK_USER_CONFIG_PATH: $CI_PROJECT_DIR/.spack
-    TMP: $CI_PROJECT_DIR/.spack-tmp
   script:
     - git clone --depth 1 -c advice.detachedHead=false -c feature.manyFiles=true --branch $SPACK_VERSION https://github.com/spack/spack $SPACK_DEV_PATH
-    - mkdir $TMP
     - cp packages.yaml $SPACK_DEV_PATH/etc/spack/packages.yaml
     - |
       cat <<EOF > $SPACK_DEV_PATH/etc/spack/defaults/upstreams.yaml
@@ -188,18 +186,20 @@ build-spack-env-on-runner:
     - spack env create $SPACK_DEV_ENV spack.yaml
     - spack env activate $SPACK_DEV_ENV
     - spack concretize -f --fresh
-    - spack install -y --fresh --no-check-signature
+    - spack install -y --fresh --no-check-signature --keep-stage
+  after_script:
+    - cp --parents /tmp/$(whoami)/spack-stage/*/*.txt ./
+    - mv ./tmp/$(whoami)/spack-stage spack-logs
+  artifacts:
+    paths:
+      - spack-logs
+    when: always
   # cache:
   #   key: spack-cache-$CI_COMMIT_REF_SLUG
   #   paths:
   #     - "$SPACK_DEV_PATH"
   #     - "$SPACK_USER_CONFIG_PATH"
   #   when: always
-  timeout: 1 day
-  artifacts:
-    paths:
-      - .spack-tmp/root/spack-stage/spack-stage-*/*.txt
-    when: on_failure
 
 
 sync-gitlab-spack-instance:
@@ -228,7 +228,7 @@ sync-gitlab-spack-instance:
     - spack load gcc@10.3.0
     - spack compiler find
     - spack compiler list
-    - spack install python@3.8.11 %gcc@10.3.0 || (cp -r /tmp/spack/spack-stage $CI_PROJECT_DIR/build_logs; exit 1)
+    - spack install --keep-stage python@3.8.11 %gcc@10.3.0
     # - for section in $(spack config list); do spack config blame $section; done
     - mkdir -p $SPACK_REPO_PATH && cp -r -t $SPACK_REPO_PATH $CI_PROJECT_DIR/{packages,repo.yaml}
     - spack repo list | grep -q ebrains-spack-builds && echo "Repository registered already" || spack repo add $SPACK_REPO_PATH
@@ -237,15 +237,17 @@ sync-gitlab-spack-instance:
     - spack env activate $SPACK_NFS_ENV
     - cp $CI_PROJECT_DIR/spack.yaml $SPACK_ROOT/var/spack/environments/$SPACK_NFS_ENV/spack.yaml
     - spack concretize -f --fresh
-    - spack install -y --fresh --no-check-signature || (cp -r /tmp/spack/spack-stage $CI_PROJECT_DIR/build_logs; exit 1)
+    - spack install -y --fresh --no-check-signature --keep-stage
     - spack module tcl refresh -y
     - spack reindex
     - spack env loads -r
-  timeout: 2 days
+  after_script:
+    - cp --parents /tmp/$(whoami)/spack-stage/*/*.txt ./
+    - mv ./tmp/$(whoami)/spack-stage spack-logs
   artifacts:
     paths:
-      - build_logs/spack-stage-*/*.txt
-    when: on_failure
+      - spack-logs
+    when: always
   only:
     refs:
       - schedules