diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ffe00d5e4d2737502517e55c77419ee6f687b953..11f821a70481309ac5eed92b0d5eaab54f6c2f68 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,19 +13,20 @@ stages: - public expire_in: 1d -.cache_latest: &cache_latest +.caching: &caching cache: - key: latest - paths: - - vendor/bundle - - assets/img/jumbotrons - -.cache_production: &cache_production - cache: - key: production - paths: - - vendor/bundle - - assets/img/jumbotrons + - key: + files: + - Gemfile.lock + prefix: "$CI_JOB_IMAGE" + paths: + - vendor/bundle + - key: jumbotron-cache + paths: + - assets/img/jumbotrons/desktop + - assets/img/jumbotrons/display_2k + - assets/img/jumbotrons/phone + - assets/img/jumbotrons/tablet .common_production: &production_before_script before_script: @@ -36,7 +37,7 @@ stages: - gem install bundler --no-document - bundle config set without 'test' - bundle install --jobs $(nproc) - <<: *cache_production + <<: *caching .common_latest: &latest_before_script before_script: @@ -48,7 +49,7 @@ stages: - bundle config set without 'test' - bundle install --jobs $(nproc) --without test "${FLAGS[@]}" - bundle update --jobs $(nproc) "${FLAGS[@]}" - <<: *cache_latest + <<: *caching .common_variables: &common_variables GIT_SUBMODULE_STRATEGY: recursive @@ -109,7 +110,7 @@ stages: --assume-extension public/" # Use yaml-lint tool to check yaml files. - "bundle exec yaml-lint _data/ _config.yml" - <<: *cache_production + <<: *caching # https://docs.gitlab.com/ce/ci/yaml/#interruptible interruptible: true