From 081ff94412c0cfca2c4b7af90ef40f48f7113acf Mon Sep 17 00:00:00 2001 From: Caleb Woodbine Date: Mon, 16 Oct 2023 12:07:55 +1300 Subject: [PATCH] feat: add Ko config path input adds an input to specify the path to a .ko.yaml config file --- .github/workflows/reusable-go-container-apps.yml | 7 +++++++ .github/workflows/reusable-ko-build.yml | 7 +++++++ README.md | 2 ++ 3 files changed, 16 insertions(+) diff --git a/.github/workflows/reusable-go-container-apps.yml b/.github/workflows/reusable-go-container-apps.yml index d56e5d9..c9d7c8f 100644 --- a/.github/workflows/reusable-go-container-apps.yml +++ b/.github/workflows/reusable-go-container-apps.yml @@ -93,6 +93,12 @@ on: type: string description: | shell commands to setup the build environment + koBuildConfigPath: + required: false + type: string + default: .ko.yaml + description: | + the path to a Ko config yaml secrets: GH_CI_USER_TOKEN: required: false @@ -119,6 +125,7 @@ jobs: registryGhcrUsernameOverride: ${{ inputs.registryGhcrUsernameOverride }} setup: ${{ inputs.buildSetup }} platforms: ${{ inputs.platforms }} + configPath: ${{ inputs.koBuildConfigPath }} scan: if: ${{ contains(fromJSON('["workflow_call", "workflow_dispatch", "push", "release"]'), github.event_name) && inputs.containerScanningEnabled && startsWith(github.repository, 'GeoNet/') != false }} needs: build diff --git a/.github/workflows/reusable-ko-build.yml b/.github/workflows/reusable-ko-build.yml index b413537..ae41e36 100644 --- a/.github/workflows/reusable-ko-build.yml +++ b/.github/workflows/reusable-ko-build.yml @@ -69,6 +69,12 @@ on: type: string description: | shell commands to setup the build environment + configPath: + required: false + type: string + default: .ko.yaml + description: | + the path to a Ko config yaml secrets: GH_CI_USER_TOKEN: required: false @@ -155,6 +161,7 @@ jobs: name: build env: KO_DOCKER_REPO: ${{ steps.run-info.outputs.ko-docker-repo }} + KO_CONFIG_PATH: ${{ inputs.configPath }} IMAGES_PATH: ${{ steps.run-info.outputs.paths }} PUSH: ${{ inputs.push }} PLATFORMS: ${{ inputs.platforms }} diff --git a/README.md b/README.md index c9d462f..cfe1987 100644 --- a/README.md +++ b/README.md @@ -118,6 +118,7 @@ jobs: # aws-role-duration-seconds: "3600" # setup: | # sudo apt install -y something-needed-for-build + # configPath: .ko.yaml ``` - dynamic build of images based on entrypoints (where there is a `package main`), unless if _inputs.paths_ is set @@ -789,6 +790,7 @@ jobs: # aws-role-duration-seconds: "3600" # buildSetup: | # sudo apt install -y something-needed-for-build + # koBuildConfigPath: .ko.yaml ``` for configuration see [`on.workflow_call.inputs` in .github/workflows/reusable-go-container-apps.yml](.github/workflows/reusable-go-container-apps.yml).