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