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 a reusable hidden job template. The build job retains the Go module, npm, and Hugo caches it consumes. Other jobs no longer inherit unrelated dependency caches. The existing clean-checkout safeguard for secret detection remains unchanged.

This follows the shared-theme implementation in docsy-gitlab!326 (merged).

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.
  • The merged configuration confirms build has the Go module, npm, and Hugo caches; other jobs do not inherit them.

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