Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 1.14 KB

README.md

File metadata and controls

34 lines (23 loc) · 1.14 KB

gcp-cloud-run-contacts

CI

An example app using GCP Cloud Run with Cloud SQL.

Project ID

  • Set the GitHub actions secret GCP_PROJECT_ID

Database preparations

https://cloud.google.com/sql/docs/postgres/connect-run

  • Create a Cloud SQL postgres instance.
  • Connect to the instance (gcloud sql connect) and create the contacts table:
create table if not exists contacts (
    id serial primary key,
    name varchar(100),
    email varchar(100)
);
  • Obtain the INSTANCE_CONNECTION_NAME (gcloud sql instances describe).
  • Set the GitHub actions secret GCP_SQL_CONNECTION_NAME.
  • Determine the postgres Data Source Name (DSN): user=postgres password=<password> database=postgres host=/cloudsql/<INSTANCE_CONNECTION_NAME>
  • Set the GitHub actions secret GCP_SQL_DSN.

Service account