group: ubuntu-runners
        steps:
          - uses: actions/checkout@v4
          - uses: actions/setup-node@v4
            with:
              node-version: '14'
          - run: npm install -g bats
          - run: bats -v
    

####  Example: Combining groups and labels

When you combine groups and labels, the runner must meet both requirements to
be eligible to run the job.

In this example, a runner group called ` ubuntu-runners ` is populated with
Ubuntu runners, which have also been assigned the label ` ubuntu-20.04-16core
` . The ` runs-on ` key combines ` group ` and ` labels ` so that the job is
routed to any available runner within the group that also has a matching
label:

    
    
    name: learn-github-actions
    on: [push]
    jobs:
      check-bats-version:
        runs-on:
          group: ubuntu-runners
          labels: ubuntu-20.04-16core
        steps:
          - uses: actions/checkout@v4
          - uses: actions/setup-node@v4
            with:
              node-version: '14'
          - run: npm install -g bats
          - run: bats -v
    

##  ` jobs.<job_id>.environment `

Use ` jobs.<job_id>.environment ` to define the environment that the job
references. All deployment protection rules must pass before a job referencing
the environment is sent to a runner. For more information, see " [ Using
environments for deployment ](/en/actions/deployment/targeting-different-
environments/using-environments-for-deployment) ."

You can provide the environment as only the environment ` name ` , or as an
environment object with the ` name ` and ` url ` . The URL maps to `
environment_url ` in the deployments API. For more information about the
deployments API, see " [ REST API endpoints for repositories
](/en/rest/repos#deployments) ."

###  Example: Using a single environment name

    
    
    environment: staging_environment
    

###  Example: Using environment name and URL

    
    
    environment:
      name: production_environment
      url: https://github.com
    

The value of ` url ` can be an expression. Allowed expression contexts: [ `
github ` ](/en/actions/learn-github-actions/contexts#github-context) , [ `
inputs ` ](/en/actions/learn-github-actions/contexts#inputs-context) , [ `
vars ` ](/en/actions/learn-github-actions/contexts#vars-context) , [ ` needs `
](/en/actions/learn-github-actions/contexts#needs-context) , [ ` strategy `
](/en/actions/learn-github-actions/contexts#strategy-context) , [ ` matrix `
](/en/actions/learn-github-actions/contexts#matrix-context) , [ ` job `
](/en/actions/learn-github-actions/contexts#job-context) , [ ` runner `
](/en/actions/learn-github-actions/contexts#runner-context) , and [ ` env `
](/en/actions/learn-github-actions/contexts#env-context) . For more
information about expressions, see " [ Expressions ](/en/actions/learn-github-
actions/expressions) ."

###  Example: Using output as URL

    
    
    environment:
      name: production_environment
      url: ${{ steps.step_id.outputs.url_output }}
    

The value of ` name ` can be an expression. Allowed expression contexts: [ `
github ` ](/en/actions/learn-github-actions/contexts#github-context) , [ `
inputs ` ](/en/actions/learn-github-actions/contexts#inputs-context) , [ `
vars ` ](/en/actions/learn-github-actions/contexts#vars-context) , [ ` needs `
](/en/actions/learn-github-actions/contexts#needs-context) , [ ` strategy `
](/en/actions/learn-github-actions/contexts#strategy-context) , and [ ` matrix
` ](/en/actions/learn-github-actions/contexts#matrix-context) . For more
information about expressions, see " [ Expressions ](/en/actions/learn-github-
actions/expressions) ."

###  Example: Using an expression as environment name

    
    
    environment:
      name: ${{ github.ref_name }}
    

##  ` jobs.<job_id>.concurrency `

You can use ` jobs.<job_id>.concurrency ` to ensure that only a single job or
workflow using the same concurrency group will run at a time. A concurrency
group can