Fix cache not stored

The cache was not stored at the end of the build pipeline because there was a check to only do this when the cache directory exists. Which is never if this guard is there.