Skip to content

Commit 32229b9

Browse files
committed
enable cloudsql
1 parent 0acaadd commit 32229b9

File tree

1 file changed

+34
-3
lines changed

1 file changed

+34
-3
lines changed

.github/workflows/_cloud-run-deploy.yml

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,22 @@ on:
3535
JSON array of container names that need authorization configuration injection (RBAC/ABAC).
3636
Example: ["api", "store", "custom-service"]
3737
Required when using auth_model or auth_policy in container_configs.
38+
<<<<<<< Updated upstream
39+
=======
40+
cloudsql_instances:
41+
required: false
42+
type: string
43+
description: >-
44+
Comma-separated list of CloudSQL instance connection names to add to the service.
45+
Example: "project:region:instance1,project:region:instance2"
46+
allow_unauthenticated:
47+
required: false
48+
type: boolean
49+
default: false
50+
description: "Whether to allow unauthenticated access to the service"
51+
52+
53+
>>>>>>> Stashed changes
3854
outputs:
3955
url:
4056
description: "The deployed Cloud Run service URL."
@@ -185,10 +201,25 @@ jobs:
185201
- name: Deploy to Cloud Run
186202
id: deploy
187203
run: |
188-
# Deploy the Knative YAML using gcloud
189-
gcloud run services replace service.deploy.yaml \
204+
# Build the base deployment command
205+
DEPLOY_CMD="gcloud run services replace service.deploy.yaml \
190206
--region=${{ vars.PULUMI_GAR_LOCATION }} \
191-
--project=${{ vars.PULUMI_GCP_PROJECT_ID }}
207+
--project=${{ vars.PULUMI_GCP_PROJECT_ID }}"
208+
209+
# Add CloudSQL instances if specified
210+
if [ -n "${{ inputs.cloudsql_instances }}" ]; then
211+
DEPLOY_CMD="$DEPLOY_CMD --add-cloudsql-instances=${{ inputs.cloudsql_instances }}"
212+
echo "Adding CloudSQL instances: ${{ inputs.cloudsql_instances }}"
213+
fi
214+
215+
# Add allow unauthenticated if specified
216+
if [ "${{ inputs.allow_unauthenticated }}" = "true" ]; then
217+
DEPLOY_CMD="$DEPLOY_CMD --allow-unauthenticated"
218+
echo "Allowing unauthenticated access"
219+
fi
220+
221+
echo "Executing deployment command: $DEPLOY_CMD"
222+
eval $DEPLOY_CMD
192223
193224
echo "Service deployed successfully!"
194225

0 commit comments

Comments
 (0)