ci: make dependency caches job-specific

Why is this change being made?

The global cache configuration is inherited by every CI job. Jobs restore Hugo, Go module, and npm caches even when they do not use them, adding avoidable transfer time to pipelines.

This change makes caches opt-in through reusable hidden job templates:

  • build extends .hugo-build-cache for the Go module, npm, and Hugo caches.
  • modules:tidy extends .hugo-module-cache for the Go module and Hugo caches.
  • Lint, security, and release jobs no longer inherit unrelated caches. The release script already clears the Go caches before creating a release.

Related tracking issue: https://gitlab.com/gitlab-com/content-sites/docsy-gitlab/-/work_items/49

Validation

  • git diff --check: passed with no output.
  • Ruby YAML parse: YAML parse: OK.
  • GitLab CI lint with include_merged_yaml enabled: valid, no errors.
  • Merged configuration: build has Go, npm, and Hugo caches; modules:tidy has Go and Hugo caches; other jobs have no inherited cache.

The lint warnings concern the existing deprecated retry.when values and are unrelated to this change.

Author and Reviewer Checklist

  • Provided a concise title for this Merge Request.
  • Explained why the change is needed.
  • Assign reviewers when ready for review.
  • Share the MR with the impacted audience when ready.
Edited by Michael Friedrich

Merge request reports

Loading
Loading