How to Store Artifacts After Tests Fail

I have a playwright test suite that runs well on my local environment but continues to hang on CI. I wanted to run the trace results outputted by playwright after the test fails but I’m unsure how to store the artifacts if I need to call - store_artifacts after the failing test step.