This is for the docs:
If the job completes successfully, the action creates a new cache with the contents of the path directory.
In some cases it could be useful to store cache key even if some build steps are failed. Could you please define a new option that allows us to use such behavior?