Skip to content

Latest commit

 

History

History
48 lines (36 loc) · 1.83 KB

README.md

File metadata and controls

48 lines (36 loc) · 1.83 KB

Deploying

The default Google Cloud Platform (GCP) infrastructural resources are managed with Terraform, which can be automated via a Github Actions workflow.

There are some manual steps that we must complete in order prior to running Terraform, and some that are necessary after the applications are up and running.

Table of Contents

  1. Create a new GCP project
  2. Register custom domains
  3. Configure Firebase
  4. Assign Github Secrets
  5. Finalize the Github workflow
  6. Post-deploy steps

Restrictions

Each storefront environment requires its own GCP project

While it would be possible to deploy multiple sets of Terraform-managed services to a single project, we can only configure a single Firebase instance per GCP project, meaning each environment would then share a user pool.

Using multiple GCP projects ensures that each environment has its own user pool.

Custom (sub)domains are necessary for the Cloud Run services

While Cloud Run gives us autogenerated URLs by default, we cannot pass those as environment variables to other Cloud Run services using Terraform because:

  • They need to be known before a service is configured
  • CMS needs to know its own URL
  • The API needs to know the front-end's URL and vice versa

If custom domains are not possible for a test implementation, you can remove the domain mappings and respective environment variables for each Cloud Run service from the Terraform files, deploy, and then create new Cloud Run revisions in the UI with the environment variables manually populated with the generated URLs.