How does pipeline pick dynamic names for artifacts

We are using multiple runners in our project to make sure pipeline is not taking much time to execute . Also we have use Build, Test, scan, containerize & publish stages .

when containerize is taking place in one runner , Publish is taken care by another runner in this case either its says image not found or its publishing existing older images to nexus . So that our changes are not being picked up .

Tried passing artifacts dynamically in .gitlab-ci.yaml but no luck

Please help me in resolving this issue .

Attaching the image of .gitlab-ci.yaml & pipeline failure

image image

Edited by kirupakaran