Skip to content

Deploy to Google Cloud Run

Masanori Ohgita edited this page Nov 30, 2024 · 5 revisions

Deploy to Google Cloud Run (Cloud Run service)

Deployed example: https://angular-nest-545045794096.us-central1.run.app/

Overview

Deploy the app to Cloud Run using automated deployment from a GitHub repository.

Deploy your app as Node.js Runtime (without Docker)

NOTE: The following settings are set to fit in the free tier, but you need to enable the Billing on your project. Also, it may not be free depending on the state of your project. In any case, I don't any guaranteed.

  1. Firstly, create your project on Google Cloud, and please remember your Project ID.
  2. Enable the following APIs on your Google Cloud project.
  3. Open the dashboard of Google Cloud Run. Then connect your repository by clicking the CONNECT REPO button.
  4. Choose the GitHub as the deployment source.
  5. Click the SETUP WITH CLOUD BUILD button.
  6. Fill the Setup with Cloud Build form.
    1. Choose your GitHub repository.
    2. Install the Cloud Build app to that repository. (It means granting Google Cloud Build permission to access repository.)
    3. Choose Branch (e.g., ^master$)
    4. Choose Build Type: Go, Node.js, Python, Java, .NET Core, ...)
    5. Click SAVE button.
  7. Fill the Configure form.
    • Service name: (Please enter any name. It will become part of the URL of your app.)
    • Authentication: Allow unauthenticated invocations
    • CPU allocation and pricing: CPU is only allocated during request processing
  8. Done. The deployment will now be performed automatically, when you pushed code to GitHub repository.
    • NOTE: If you want to perform the deployment manually, you can do it by clicking the Run button on the row of the list of Cloud Build Triggers.