Skip to content
Snippets Groups Projects
Commit e5380cdc authored by Huste, Tobias's avatar Huste, Tobias :rabbit: Committed by Huste, Tobias
Browse files

Fix and improve caching in GitLab CI

parent f1b133aa
No related branches found
No related tags found
1 merge request!608Fix and improve caching in GitLab CI
...@@ -13,19 +13,20 @@ stages: ...@@ -13,19 +13,20 @@ stages:
- public - public
expire_in: 1d expire_in: 1d
.cache_latest: &cache_latest .caching: &caching
cache: cache:
key: latest - key:
paths: files:
- vendor/bundle - Gemfile.lock
- assets/img/jumbotrons prefix: "$CI_JOB_IMAGE"
paths:
.cache_production: &cache_production - vendor/bundle
cache: - key: jumbotron-cache
key: production paths:
paths: - assets/img/jumbotrons/desktop
- vendor/bundle - assets/img/jumbotrons/display_2k
- assets/img/jumbotrons - assets/img/jumbotrons/phone
- assets/img/jumbotrons/tablet
.common_production: &production_before_script .common_production: &production_before_script
before_script: before_script:
...@@ -36,7 +37,7 @@ stages: ...@@ -36,7 +37,7 @@ stages:
- gem install bundler --no-document - gem install bundler --no-document
- bundle config set without 'test' - bundle config set without 'test'
- bundle install --jobs $(nproc) - bundle install --jobs $(nproc)
<<: *cache_production <<: *caching
.common_latest: &latest_before_script .common_latest: &latest_before_script
before_script: before_script:
...@@ -48,7 +49,7 @@ stages: ...@@ -48,7 +49,7 @@ stages:
- bundle config set without 'test' - bundle config set without 'test'
- bundle install --jobs $(nproc) --without test "${FLAGS[@]}" - bundle install --jobs $(nproc) --without test "${FLAGS[@]}"
- bundle update --jobs $(nproc) "${FLAGS[@]}" - bundle update --jobs $(nproc) "${FLAGS[@]}"
<<: *cache_latest <<: *caching
.common_variables: &common_variables .common_variables: &common_variables
GIT_SUBMODULE_STRATEGY: recursive GIT_SUBMODULE_STRATEGY: recursive
...@@ -109,7 +110,7 @@ stages: ...@@ -109,7 +110,7 @@ stages:
--assume-extension public/" --assume-extension public/"
# Use yaml-lint tool to check yaml files. # Use yaml-lint tool to check yaml files.
- "bundle exec yaml-lint _data/ _config.yml" - "bundle exec yaml-lint _data/ _config.yml"
<<: *cache_production <<: *caching
# https://docs.gitlab.com/ce/ci/yaml/#interruptible # https://docs.gitlab.com/ce/ci/yaml/#interruptible
interruptible: true interruptible: true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment