Answers: <p>Register Different runners with tags depending on their resources:</p>
  <p><strong>Example:</strong></p>
  <ul>
  <li><strong>Lightweight Runner:</strong> Tag as lightweight</li>
  <li><strong>Heavyweight Runner:</strong> Tag as heavyweight</li>
  </ul>
  <p><strong>Use the same tags respectively in .gitlab-ci.yml</strong></p>
  <pre><code>lightweight_job:
    stage: test
    script:
      - echo &quot;Running lightweight job&quot;
    tags:
      - lightweight
  </code></pre>
  <p><strong>For heavyweight Use different tags:</strong></p>
  <pre><code>heavyweight_job:
    stage: build
    script:
      - echo &quot;Running heavyweight job&quot;
      - ./generate-docs.sh
      - ./run.sh
    tags:
      - heavyweight
  </code></pre>
  <p>Also, you can use the rules keyword to determine when jobs should run based on the type of Git event, and then assign specific tags to each job.</p>
  
Answers: CC BY-SA 4.0
Answers: 2024-05-16T07:32:06.567Z
Answers: 2024-05-16T07:32:06.567Z
Answers: Ravi Kyada
Body: <p>My Gitlab project is using the Gitlab pipelines, and I would want to use a different Gitlab Runner depending on whether the trigger is a simple push, or e.g. a tag marking a release.</p>
  <p>The idea is that the runner triggered by a push is only consuming a short processing time, whereas the release triggered pipeline is creating a lot of documentation and reports etc., and blocking the resources for hours. In that time, the lightweight runs would be pending.</p>
  <p>Adding another machine to run the Runner is not an option due to license topics.</p>
  <p>So I would look for a solution where I can configure in the gitlab-ci.yml which runner to use. Is that somehow possible?</p>
  <p>Thanks!</p>
  
Tags: <gitlab>
Title: Different Gitlab Runners depending on the Tag/Branch
UserDisplayName: Markus Erlacher
ThreadText: # Different Gitlab Runners depending on the Tag/Branch
  
  (Asked by: username_0 on 2024-05-14)
  
  My Gitlab project is using the Gitlab pipelines, and I would want to use a different Gitlab Runner depending on whether the trigger is a simple push, or e.g. a tag marking a release.
  
  The idea is that the runner triggered by a push is only consuming a short processing time, whereas the release triggered pipeline is creating a lot of documentation and reports etc., and blocking the resources for hours. In that time, the lightweight runs would be pending.
  
  Adding another machine to run the Runner is not an option due to license topics.
  
  So I would look for a solution where I can configure in the gitlab-ci.yml which runner to use. Is that somehow possible?
  
  Thanks!
  
  **Tags:** gitlab
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-05-16. Score: 1 | Accepted answer
  
  Register Different runners with tags depending on their resources:
  
  **Example:**
  
  * **Lightweight Runner:** Tag as lightweight
  * **Heavyweight Runner:** Tag as heavyweight
  
  **Use the same tags respectively in .gitlab-ci.yml**
  
  ```
  lightweight_job:
    stage: test
    script:
      - echo "Running lightweight job"
    tags:
      - lightweight
  
  ```
  
  **For heavyweight Use different tags:**
  
  ```
  heavyweight_job:
    stage: build
    script:
      - echo "Running heavyweight job"
      - ./generate-docs.sh
      - ./run.sh
    tags:
      - heavyweight
  
  ```
  
  Also, you can use the rules keyword to determine when jobs should run based on the type of Git event, and then assign specific tags to each job.
  
  
  ---
  
  