diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d8a6f42472873377733f203520bc492965bb319f..a196ce2817f273599db2decd7fa88e84c0332aae 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -63,6 +63,7 @@ default:
 
     - - echo -e "\e[0Ksection_start:`date +%s`:ccache_config[collapsed=true]\r\e[0KSetting up ccache config"
       - echo Adding ccache configution option
+      - mkdir --parents --verbose ~/.ccache/
       - touch ~/.ccache/ccache.conf
       - echo base_dir = $PWD                  | tee --append ~/.ccache/ccache.conf
       - echo cache_dir = $PWD/ccache          | tee --append ~/.ccache/ccache.conf