79564396

Date: 2025-04-09 13:01:07
Score: 2
Natty:
Report link

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

Reasons:
  • RegEx Blacklisted phrase (1.5): solve the issue?
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: MichaƂ Miler