Skip to content

Commit 303e009

Browse files
committed
Add runs_on input to deploy reusable workflows
1 parent 42ec1e5 commit 303e009

4 files changed

Lines changed: 25 additions & 2 deletions

File tree

.github/workflows/build_and_publish_docker_image_to_container_registry.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ on:
3737
type: string
3838
default: "."
3939

40+
runs_on:
41+
description: "Runner to execute the job on (e.g. 'ubuntu-latest' or a self-hosted runner label)."
42+
required: false
43+
type: string
44+
default: "ubuntu-latest"
45+
4046
secrets:
4147
registry_username:
4248
description: "Username for container registry"
@@ -62,7 +68,7 @@ permissions:
6268

6369
jobs:
6470
build-and-push-docker-image-to-container-registry:
65-
runs-on: ubuntu-latest
71+
runs-on: ${{ inputs.runs_on }}
6672
permissions:
6773
contents: read
6874
packages: write

.github/workflows/deploy_to_development.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ on:
3535
required: false
3636
type: string
3737
default: ""
38+
runs_on:
39+
description: "Runner label for the image-build job (e.g. 'ubuntu-latest' or a self-hosted runner label). The deployment update job always uses ubuntu-latest."
40+
required: false
41+
type: string
42+
default: "ubuntu-latest"
3843
secrets:
3944
registry_username:
4045
required: true
@@ -72,6 +77,7 @@ jobs:
7277
tag: ${{ needs.get-short-sha.outputs.tag }}
7378
path_to_dockerfile: ${{ inputs.path_to_dockerfile }}
7479
path_to_context: ${{ inputs.path_to_context }}
80+
runs_on: ${{ inputs.runs_on }}
7581
secrets:
7682
registry_username: ${{ secrets.registry_username }}
7783
registry_password: ${{ secrets.registry_password }}

.github/workflows/deploy_to_staging.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ on:
3636
required: false
3737
type: string
3838
default: "."
39+
runs_on:
40+
description: "Runner label for the image-build job (e.g. 'ubuntu-latest' or a self-hosted runner label). The deployment update job always uses ubuntu-latest."
41+
required: false
42+
type: string
43+
default: "ubuntu-latest"
3944
secrets:
4045
registry_username:
4146
required: true
@@ -62,6 +67,7 @@ jobs:
6267
secondary_tag: latest
6368
path_to_dockerfile: ${{ inputs.path_to_dockerfile }}
6469
path_to_context: ${{ inputs.path_to_context }}
70+
runs_on: ${{ inputs.runs_on }}
6571
secrets:
6672
registry_username: ${{ secrets.registry_username }}
6773
registry_password: ${{ secrets.registry_password }}

.github/workflows/promote_to_production.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ on:
2626
author_name:
2727
required: true
2828
type: string
29+
runs_on:
30+
description: "Runner label for the image-copy job (e.g. 'ubuntu-latest' or a self-hosted runner label). The deployment update job always uses ubuntu-latest."
31+
required: false
32+
type: string
33+
default: "ubuntu-latest"
2934
secrets:
3035
staging_registry_username:
3136
required: true
@@ -76,7 +81,7 @@ jobs:
7681
copy-image-to-production:
7782
name: Copy staging image to production registry
7883
needs: get-staging-version
79-
runs-on: ubuntu-latest
84+
runs-on: ${{ inputs.runs_on }}
8085
steps:
8186
- name: Log in to staging registry
8287
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 #v4

0 commit comments

Comments
 (0)