Integrate existing GitLab job with GitLab pages job

39 views Asked by At

I have multiple GitLab jobs in my current GitLab project.

.gitlab-ci.yml

stages:
    - .pre
    - publish

variables:
    NPM_DOCKER_IMAGE: node:15.7.0-alpine3x

image: $NPM_DOCKER_IMAGE

build-product1:
    stage: .pre
    image: $NPM_DOCKER_IMAGE
    script:
        - cd source/product1
        - npm install
        - npm run-script build
    artifacts:
        paths:
            - source/product1/output

build-product2:
    stage: .pre
    image: $NPM_DOCKER_IMAGE
    script:
        - cd source/product2
        - npm install
        - npm run-script build
    artifacts:
        paths:
            - source/product2/output

Above jobs gets executed as part of GitLab pipeline and deploys corresponding product which can be accessed via UI.

Now I want to use GitLab pages to deploy these products. Now when I add pages job, pipeline does not run these product specific jobs (mentioned above).

pages: 
  stage: publish 
  script: 
    - mkdir public 
    - cp -r source/* public 
    - ls -al public
  artifacts: 
    paths: 
      - public

Am I missing anything in my config?

0

There are 0 answers