Hi, @skeddles. If the cached content is not your publish directory and doesn’t include it as subdirectory, you can append something like
&& rm -Rf path/to/directory/to/delete to your build command.
Please note, that
&& is important. If you add it using
; and not
&& it will hide build failures (it “swallows” the exit code error) and that will cause failed builds to be published.
Clearly, publishing failed builds is not something we want to do.
For example, if the build command is
npm run build and the path you do not want to cache is
./themes/theme-name then then you can keep the build image from caching that directory with:
npm run build && rm -Rf ./themes/theme-name
If that doesn’t work or if there are other questions, please let us know.