diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 048afc17c3a891b3f84d45c1f5dd3004797eddbd..fcd45fca080f211dfbc715d774e9220313e08371 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -11,16 +11,15 @@ clang-format:
     - git submodule update --init --depth 1 --recursive
     - bash .ci/scripts/format/script.sh
 
-cache:
-  paths:
-    - ccache/
-
 build-linux:
   stage: build
   image: suyuemu/cibuild:linux-x64
   resource_group: linux-ci
   variables:
     RELEASE_NAME: mainline
+  cache:
+    paths:
+      - ccache/
   before_script:
     - mkdir -p ccache
     - export CCACHE_BASEDIR=${PWD}