diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 009ab76742a0f7cdf39097b2a766aec5f20d95dd..d90c8ea24d900ee2747a45693c35d4238a62cecb 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -202,7 +202,7 @@ spack:install:
           -e ${environment}
           buildcache create
           --update-index
-          --key EDC904DCE3D2E84E
+          --key ${GPG_KEY_ID}
           ${MOUNT_POINT}/buildcache
 
     - ${STACK_LOCATION}/spack/bin/spack
diff --git a/ci/install_compilers.sh b/ci/install_compilers.sh
index a9863839eb75542728d8cc16d91e3d02163ee2ba..3edbae28d9853df4213942f64db3eedb051c58c7 100755
--- a/ci/install_compilers.sh
+++ b/ci/install_compilers.sh
@@ -60,7 +60,7 @@ for c in  "core_compilers" "compilers"; do
             --color always \
             buildcache create \
             --update-index \
-            --key EDC904DCE3D2E84E \
+            --key ${GPG_KEY_ID} \
             ${MOUNT_POINT}/buildcache ${hashes}
 
         for compiler_hash in $(echo ${hashes}); do