How to multiple runner to deploy

Hello. all.

I registered two gitlab-runners in one project.
When I run the pipeline, only one gitlab-runner is distributed.
Is it not possible to distribute to multiple gitlab-runners?
I need your help.

This is my .gitlab-ci.yml below:

cache:
  paths:
    - server/node_modules/

stages:
  - deploy_api

deploy-api:
  stage: deploy_api
  tags:
    - dev
  only:
    - deploy-dev
  script:
    - pwd
    - cd server
    - pwd
    - npm install
    - npm run pm2

Regards, David.

There is only one job in that .gitlab-ci.yml file, and any job will only run on one runner.

If you have more jobs they will be distributed.

If what you want is not actually distribution (spreading the load across servers) as much as duplication (getting the job run on multiple servers), you’ll either need to make one job that does the job on all servers or multiple jobs that each does the job on one server (and use different tags to make them picked up by different runners. I’m not the expert on that, but it’s mostly a question about what you want to parallelise the process and how much work you want when you change the set of servers that your stuff needs to be deplyed to.

Thank you for reply.

I got it and I’lll try.

Thank you again.

Regards, david.