Skip to content

Commit 5dbf2e8

Browse files
committed
Enabled --regions
1 parent 2028e2d commit 5dbf2e8

3 files changed

Lines changed: 24 additions & 7 deletions

File tree

action.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,15 @@ inputs:
294294

295295
region:
296296
description: |-
297-
Region in which the Cloud Run services are deployed.
297+
Region in which the Cloud Run services are deployed. Providing a list enables
298+
multi-region deployment. See the [documentation for deploying a multi-region
299+
service](https://docs.cloud.google.com/run/docs/multiple-regions#deploy)
300+
301+
Please note, this GitHub Action cannot parse regions provided in the metadata
302+
YAML file and will always fallback to the region provided here, defaulting always
303+
to `us-central1` if none is given. This is a known issue but this behavior being
304+
kept to avoid breaking existing actions.
305+
298306
default: 'us-central1'
299307
required: false
300308

package-lock.json

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,14 @@ export async function run(): Promise<void> {
248248
.flat()
249249
.filter((e) => e !== undefined && e !== null && e !== '')
250250
.join(',');
251-
deployCmd.push('--region', regions);
252-
updateTrafficCmd.push('--region', regions);
253-
}
254-
if (projectId) {
255-
deployCmd.push('--project', projectId);
256-
updateTrafficCmd.push('--project', projectId);
251+
252+
if (region?.length > 1) {
253+
deployCmd.push('--regions', regions);
254+
updateTrafficCmd.push('--regions', regions);
255+
} else {
256+
deployCmd.push('--region', regions);
257+
updateTrafficCmd.push('--region', regions);
258+
}
257259
}
258260

259261
// Add optional deploy flags

0 commit comments

Comments
 (0)