Skip to content

nakamasato/cloud-run-app-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

cloud-run-app-template

This is a template for a Cloud Run app.

You can initialize a GitHub repository to manage Cloud Run services with Terraform:

  • Deploy a Cloud run service with Terraform
  • Set up a GitHub Actions workflow for the Terraform

Steps

  1. Create a repo from this template.

    gh repo create <your new repo name> --template=nakabonne/cloud-run-app-template
    
  2. Create a GCS bucket for Terraform backend if needed (optional).

    gsutil mb -p "<gcp project>" -l "<region>" gs://"<bucket>"
    
  3. Write your own config files.

    terraform.tfvars:

    project      = "<gcp project>"
    region       = "<region>"
    service_name = "<Cloud Run service name>"

    terraform.tfbackend:

    bucket  = "<bucket for Terraform state>"
  4. Run terraform init -backend-config=terraform.tfbackend

  5. Run terraform apply

  6. Set up GitHub Actions secrets PROVIDER_NAME and SA_EMAIL.

    gh secret set PROVIDER_NAME --body=$(terraform output github_actions_provider_name | tr -d '"')
    gh secret set SA_EMAIL --body=$(terraform output github_actions_sa_email | tr -d '"')
    
  7. Push to your repo.

For more details, please read terraform.

Application

TBD

Ref

  1. terraform-google-cloud-run
  2. terraform-google-modules/terraform-google-github-actions-runners

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages