Enable assets caching on security stable branches
What does this MR do and why?
We're currently not seeing the cache-assets appear in the security stable branches. This is causing compile-production-assets jobs to take a long time, due to the caching not correctly working.
We attempted to enable caching in !195670 (merged) but that didn't work as intended: https://gitlab.com/gitlab-org/security/gitlab/-/pipelines/1903297011
In this MR, I'm copying over some rules used for compile-production-assets (code) to cache-assets rules block, in hopes that this will create the job in the security stable branches.
Essentially, in the pipelines where there are compile asset jobs, there should be cache asset jobs.
I'm under the impression that it's okay to create this caching job more often (regardless of the changes), because if it detects that the same asset hash has already been cached, it shouldn't try to re-build the cache. We can iterate to narrow down the scope once we have validated that it works as intended.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.