From 303e009e4e4040b59835e9d0f50d23512adea776 Mon Sep 17 00:00:00 2001 From: Christian de Jonge Date: Mon, 17 Aug 2026 13:51:31 +0200 Subject: [PATCH] Add runs_on input to deploy reusable workflows --- ...ild_and_publish_docker_image_to_container_registry.yml | 8 +++++++- .github/workflows/deploy_to_development.yml | 6 ++++++ .github/workflows/deploy_to_staging.yml | 6 ++++++ .github/workflows/promote_to_production.yml | 7 ++++++- 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_and_publish_docker_image_to_container_registry.yml b/.github/workflows/build_and_publish_docker_image_to_container_registry.yml index 7207716..2e906e9 100644 --- a/.github/workflows/build_and_publish_docker_image_to_container_registry.yml +++ b/.github/workflows/build_and_publish_docker_image_to_container_registry.yml @@ -37,6 +37,12 @@ on: type: string default: "." + runs_on: + description: "Runner to execute the job on (e.g. 'ubuntu-latest' or a self-hosted runner label)." + required: false + type: string + default: "ubuntu-latest" + secrets: registry_username: description: "Username for container registry" @@ -62,7 +68,7 @@ permissions: jobs: build-and-push-docker-image-to-container-registry: - runs-on: ubuntu-latest + runs-on: ${{ inputs.runs_on }} permissions: contents: read packages: write diff --git a/.github/workflows/deploy_to_development.yml b/.github/workflows/deploy_to_development.yml index e4211f7..4ff7879 100644 --- a/.github/workflows/deploy_to_development.yml +++ b/.github/workflows/deploy_to_development.yml @@ -35,6 +35,11 @@ on: required: false type: string default: "" + runs_on: + 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." + required: false + type: string + default: "ubuntu-latest" secrets: registry_username: required: true @@ -72,6 +77,7 @@ jobs: tag: ${{ needs.get-short-sha.outputs.tag }} path_to_dockerfile: ${{ inputs.path_to_dockerfile }} path_to_context: ${{ inputs.path_to_context }} + runs_on: ${{ inputs.runs_on }} secrets: registry_username: ${{ secrets.registry_username }} registry_password: ${{ secrets.registry_password }} diff --git a/.github/workflows/deploy_to_staging.yml b/.github/workflows/deploy_to_staging.yml index b5b52bf..d1954f4 100644 --- a/.github/workflows/deploy_to_staging.yml +++ b/.github/workflows/deploy_to_staging.yml @@ -36,6 +36,11 @@ on: required: false type: string default: "." + runs_on: + 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." + required: false + type: string + default: "ubuntu-latest" secrets: registry_username: required: true @@ -62,6 +67,7 @@ jobs: secondary_tag: latest path_to_dockerfile: ${{ inputs.path_to_dockerfile }} path_to_context: ${{ inputs.path_to_context }} + runs_on: ${{ inputs.runs_on }} secrets: registry_username: ${{ secrets.registry_username }} registry_password: ${{ secrets.registry_password }} diff --git a/.github/workflows/promote_to_production.yml b/.github/workflows/promote_to_production.yml index adc84a6..4783615 100644 --- a/.github/workflows/promote_to_production.yml +++ b/.github/workflows/promote_to_production.yml @@ -26,6 +26,11 @@ on: author_name: required: true type: string + runs_on: + 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." + required: false + type: string + default: "ubuntu-latest" secrets: staging_registry_username: required: true @@ -76,7 +81,7 @@ jobs: copy-image-to-production: name: Copy staging image to production registry needs: get-staging-version - runs-on: ubuntu-latest + runs-on: ${{ inputs.runs_on }} steps: - name: Log in to staging registry uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 #v4