GitHub Actions — Solving actions/cache@v2 for self-hosted runners on GitHub Enterprise. GHES support.
In this story, I am going to present an alternative solution to actions/cache Github action. This solution is mostly for self-hosted runners, running actions on Github Enterprise. As actions/cache are not supported on Github Enterprise, https://github.com/actions/cache/issues/505. Also, you might have noticed a warning show that upon the cache step: Cache action is not supported on GHES.
Later in this story, I propose a temporary alternative solution, which you might find useful.
The cache action will not be supported on GitHub Enterprise Server, at least for the initial release. If there’s a strong demand for caching on GHES, this could definitely change. Part of the reasoning behind this decision is:
1. Since GHES uses self-hosted runners, dependencies are typically cached on the runner by whatever dependency management tool is being used (
npm
,maven
, etc.), so saving these to an external cache would be less efficient.2. Some workflows use the cache to share data between multiple jobs in a workflow. GHES will have the upload and download artifact actions available.
https://github.com/actions/cache/issues/505#issuecomment-758740690