The when key can have one of three different values and controls under what circumstances artifacts are uploaded:
- on_success: Only upload artifacts when the job is successful (default).
- on_failure: Only upload artifacts when the job fails. This is useful if you want to examine failed builds.
- always: Upload artifacts, regardless of whether the job succeeds or not.