Skip to content

Commit fa555a0

Browse files
committed
Add support for docker_registry and kms_key_name
1 parent 564e6a0 commit fa555a0

File tree

4 files changed

+31
-3
lines changed

4 files changed

+31
-3
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,18 @@ steps:
102102
- `build_environment_variables_file`: (Optional) Path to a local YAML file
103103
containing variables. See 'env_vars_file' for syntax.
104104

105+
- `docker_repository`: (Optional) User managed repository created in Artifact
106+
Registry optionally with a customer managed encryption key. If specified,
107+
deployments will use Artifact Registry. If unspecified and the deployment is
108+
eligible to use Artifact Registry, GCF will create and use a repository named
109+
'gcf-artifacts' for every deployed region. This is the repository to which the
110+
function docker image will be pushed after it is built by Cloud Build.
111+
112+
- `kms_key_name`: (Optional) Resource name of a Google Cloud KMS crypto key used
113+
to encrypt/decrypt function resources. If specified, you must also provide an
114+
artifact registry repository using the `docker_repository` field that was
115+
created with the same key.
116+
105117
- `credentials`: (**Deprecated**) This input is deprecated. See [auth section](https://github.com/google-github-actions/deploy-cloud-functions#via-google-github-actionsauth) for more details.
106118
Service account key to use for authentication. This should be
107119
the JSON formatted private key which can be exported from the Cloud Console. The

action.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,19 @@ inputs:
145145
description: |-
146146
Path to a local YAML file containing variables. See 'env_vars_file' for
147147
syntax.
148+
required: false
149+
150+
docker_repository:
151+
description: |-
152+
User managed repository created in Artifact Registry.
153+
required: false
154+
155+
kms_key_name:
156+
description: |-
157+
Resource name of a Google Cloud KMS crypto key used to encrypt/decrypt
158+
function resources. If specified, you must also provide an artifact
159+
registry repository using the 'docker_repository' field that was created
160+
with the same key.
148161
required: false
149162

150163
outputs:

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ async function run(): Promise<void> {
6767
getInput('build_environment_variables_file'),
6868
);
6969

70+
const dockerRepository = presence(getInput('docker_repository'));
71+
const kmsKeyName = presence(getInput('kms_key_name'));
72+
7073
// Add warning if using credentials
7174
let credentialsJSON:
7275
| ServiceAccountKey
@@ -121,11 +124,11 @@ async function run(): Promise<void> {
121124
availableMemoryMb: availableMemoryMb ? +availableMemoryMb : undefined,
122125
buildEnvironmentVariables: buildEnvironmentVariables,
123126
// buildWorkerPool: buildWorkerPool, // TODO: add support
124-
// dockerRepository: dockerRepository, // TODO: add support
127+
dockerRepository: dockerRepository,
125128
entryPoint: entryPoint,
126129
environmentVariables: environmentVariables,
127130
ingressSettings: ingressSettings,
128-
// kmsKeyName: kmsKeyName, // TODO: add support
131+
kmsKeyName: kmsKeyName,
129132
labels: labels,
130133
maxInstances: maxInstances ? +maxInstances : undefined,
131134
// minInstances: minInstances ? + minInstances : undefined, // TODO: add support

0 commit comments

Comments
 (0)