diff --git a/README.md b/README.md index 9cab529..be5eb40 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ jobs: project_id: 'my-project' namespace: 'my-namespace' expose: '8000' + k8s_manifests: 'configs' - name: 'get-deployments' shell: bash @@ -65,3 +66,9 @@ jobs: - `expose` - (Optional) The port provided will be used to expose the deployed workload object (i.e., port and targetPort will be set to the value provided in this flag). If not provided, it will not be passed to the binary. + +- `k8s_manifests` - (Optional) Local or GCS path to configuration file or + directory of configuration files to use to create Kubernetes objects + (file or files in directory must end in ".yml" or ".yaml"). + Prefix this value with "gs://" to indicate a GCS path. + If not provided, it will not be passed to the binary. diff --git a/action.yml b/action.yml index e358878..f1aab9b 100644 --- a/action.yml +++ b/action.yml @@ -55,6 +55,13 @@ inputs: If not provided, it will not be passed to the binary. required: false + k8s_manifests: + description: |- + Local or GCS path to configuration file or directory of configuration files to use to create Kubernetes objects (file or files in directory must end in ".yml" or ".yaml"). + Prefix this value with "gs://" to indicate a GCS path. + If not provided, it will not be passed to the binary. + required: false + branding: icon: 'lock' color: 'blue' diff --git a/entrypoint.sh b/entrypoint.sh index 49149a3..07b53d9 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -23,6 +23,7 @@ cluster_name="$4" project_id="$5" namespace="$6" expose_port="$7" +k8s_manifests="$8" gke_deploy_command="gke-deploy run -i $image -a $app_name -l $location -c $cluster_name -p $project_id" @@ -42,6 +43,11 @@ if [ -n "$expose_port" ]; then gke_deploy_command="$gke_deploy_command -x $expose_port" fi +# Add k8s manifests file(s) if the input is apparent. +if [ -n "$k8s_manifests" ]; then + gke_deploy_command="$gke_deploy_command -f $k8s_manifests" +fi + # Utilize Google APIs user agent for metrics with the following unique identifier: export GOOGLE_APIS_USER_AGENT=google-github-action:deploy-gke/$gha_version