Cleanup builds dir after build
Description
We have a large number of projects running on a single buildserver using the docker exector. Some projects have a large repository so it takes time to clone these projects each time. Therefor we are using the git fetch strategy. Which works fine for a long time now. After some time we had issues with the number of free inodes. When I was digging in to this issue I found out that the 2 runners we are using with 4 concurrent jobs each had created a large number of build directories in the configured cache directory. Since most of our projects are using npm to install external packages each folder contained a node_modules folder with several thousands of files in there, not consuming diskspace but inodes.
I disabled the cache by setting the disable_cache flag on the runners. which prevents the runner from creating to many files on disk. But now the file projects is discarded after a build. And it takes a lot of time to clone all projects on each build.
We are using the npm cache in a global mounted folder to speed up the npm install process. But there doesn't seems to be a way to only "cache" the clean git clone.
Proposal
It would be nice if there was an option to cache all project files but exclude some unwanted folders. Or to tell the runner that it should only cache the sources from git and any additional specified files instead of keeping the full build directory on disk.