Skip to content

Commit

Permalink
Merge pull request #13 from stefda/vpc-connector-input
Browse files Browse the repository at this point in the history
Allow setting VPC connector
  • Loading branch information
stefda authored Aug 13, 2021
2 parents dc3233a + ce5a529 commit bba9d76
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ In your actions workflow, somewhere after the step that builds

```bash
- name: Deploy service to Cloud Run
uses: stefda/action-cloud-run@v1.5
uses: stefda/action-cloud-run@v1.6
with:
image: gcr.io/[your-project]/[image]
service: [your-service]
Expand Down Expand Up @@ -46,4 +46,4 @@ If you don't provide a path to .env file the deployment will be triggered with t

The `cloud sql` input links your service to a CloudSQL instance. See
the [doc](https://cloud.google.com/sql/docs/mysql/connect-run) that explains
what happend behind the scenes.
what happens behind the scenes.
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ inputs:
env:
description: 'Path to .env file which will be added to the Cloud Run deployment'
required: false
vpc connector:
description: 'VPC connector name'
required: false
runs:
using: 'docker'
image: 'Dockerfile'
5 changes: 5 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ then
ENV_FLAG="--add-cloudsql-instances $INPUT_CLOUD_SQL --set-env-vars INSTANCE_CONNECTION_NAME=$INPUT_CLOUD_SQL $ENV_FLAG"
fi

if [ "$VPC_CONNECTOR" ]
then
ENV_FLAG="--vpc-connector $VPC_CONNECTOR"
fi

gcloud auth activate-service-account --key-file="$HOME"/gcloud.json --project "$INPUT_PROJECT"
gcloud auth configure-docker

Expand Down

0 comments on commit bba9d76

Please sign in to comment.