CI: Specifying artifact dependencies when using `parallel: matrix:`

If I have a job that runs in parallel and produces different artifacts on each run how do I specify the dependencies on a particular parallel job.

E.g.

build:
  script:
       - "echo $JOB > artifact.txt"
   parallel:
     matrix:
       - JOB: ["1", "2"]
   artifacts:
      paths: artifact.txt

deploy:
  dependencies:
     - build # but which one?
  script:
     - cat artifact.txt
1 Like

I was looking for exactly the same. I was able to use the calculated job name which should be something like this in your case:

dependencies: ["build: [1]"]

I couldn’t find anything in the docs related to this, maybe it’s worth to add some notes there too.