Skip to content

saleskick-com/cloudsql-proxy-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CloudSQL Proxy for Github Actions

Github Action which will start a Google Cloud SQL Proxy as a Docker container.

Forked from mattes/gce-cloudsql-proxy-action to support Cloud SQL Auth proxy v2 & add a few small improvements.

Setup

  • A running Cloud SQL instance with a public IP address
  • Create a new Service Account (Recommended: dedicated for this purpose) with the Cloud SQL Client Role
  • Generate a JSON Key for this Service Account:
    • Go to the API & Services - Credentials page
    • Under Service Accounts, click on the Service Account you created
    • Go to the Keys tab -> Add Key -> Create new key
    • Select JSON and click Create -> Save the file
  • Add the content of the JSON Key file as a new Secret in your Github repository
    • Go to the Settings tab of your repository
    • Click on Secrets -> Actions -> New repository secret
    • Give it a name (i.e.: CLOUD_SQL_CREDENTIALS), and paste the content of the JSON Key file as the value

Action Inputs

Variable Description
creds Required Service Account JSON Key (not base64 encoded)
instance Required Cloud SQL connection name
port Listen on port, default: 5432
proxy_version Cloud SQL Proxy version, default: 2.20.0
startup_attempts Number of attempts to wait for the proxy to start, default: 10

Usage

uses: saleskick-com/cloudsql-proxy-action@v1
with:
  creds: ${{ secrets.CLOUD_SQL_CREDENTIALS }}
  instance: my-project:us-central1:instance-1

End User License Agreement (EULA)

All users of this project must agree to the terms and conditions outlined in the EULA before using the software.

License

This project is licensed under the Unlicense.

About

Github Action which will start a Google Cloud SQL Proxy as a Docker container.

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • Shell 100.0%