Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional input k8s_manifests #15

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
project_id: 'my-project'
namespace: 'my-namespace'
expose: '8000'
k8s_manifests: 'configs'

- name: 'get-deployments'
shell: bash
Expand Down Expand Up @@ -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.
7 changes: 7 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
6 changes: 6 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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

Expand Down