Indeed sharing artifacts between matrix jobs is not straightforward but it's possible to do it in a clean way. Maybe solution explained in our blog post would solve the issue?
stages:
- build
- deploy
.apps:
parallel:
matrix:
- APP_NAME: one
- APP_NAME: two
build:
stage: build
extends:
- .apps
environment: $APP_NAME
script:
- build.sh
- mv dist dist-$APP_NAME # update `dist` to reflect your case
artifacts:
paths:
- dist-$APP_NAME
expire_in: 1 hour
deploy:
stage: deploy
extends:
- .apps
environment: $APP_NAME
needs:
- dist
script:
- cd dist-$APP_NAME
- ls # all build artifacts for $APP_NAME are available in `dist-$APP_NAME`
- deploy.sh
Check out more here: https://u11d.com/blog/sharing-artifacts-between-git-lab-ci-matrix-jobs-react-build-example