From 020729cdf54dbe397c183d2e9ccb14dfed0cf26b Mon Sep 17 00:00:00 2001
From: Jean-Paul Calderone <exarkun@twistedmatrix.com>
Date: Mon, 28 Jun 2021 08:27:24 -0400
Subject: [PATCH] cachix docs suggest splitting this up so why not

---
 .gitlab-ci.yml | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 85d38040..874f560f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -41,14 +41,20 @@ morph-builds:
     # thanks to project-level configuration.
     CACHIX_NAME: "privatestorage-opensource"
 
-  script:
+  before_script:
     - |
       nix-env -iA nixpkgs.cachix nixpkgs.bash
       cachix use privatestorage-opensource
       nix path-info --all > /tmp/store-path-pre-build
+
+  script:
+    - |
       for grid in morph/grid/*/grid.nix; do
           morph build "${grid}"
       done
+
+  after_script:
+    - |
       bash -c "comm -13 <(sort /tmp/store-path-pre-build | grep -v '\.drv$') <(nix path-info --all | grep -v '\.drv$' | sort) | cachix push $CACHIX_NAME"
 
 vulnerability-scan:
-- 
GitLab