React app based on an open-source template that uses a map to help spread global news instantaneously.
- Create a container registry repository with the name
map-my-news - Build Docker image locally:
docker build . --tag map-my-news:v1.0.0
- Push the first image
map-my-news:v1.0.0built based on yourDockerfileto container registry - Create a cloud run service based on the pushed
map-my-news:v1.0.0image - Use the
cloudbuild.yamlin this repo to re-deploy to cloud run:
gcloud builds submit --substitutions=_LOCATION="us-central1",_REPOSITORY="map-my-news",_IMAGE="map-my-news:v1.0.0" .
- Give cloud build permission to push to cloud run:
gcloud projects add-iam-policy-binding <project_id> \
--member "serviceAccount:<numeric_project_id>@cloudbuild.gserviceaccount.com" \
--role roles/run.admin
gcloud iam service-accounts add-iam-policy-binding \
<numeric_project_id>-compute@developer.gserviceaccount.com \
--member="serviceAccount:<numeric_project_id>@cloudbuild.gserviceaccount.com" \
--role="roles/iam.serviceAccountUser"
- create a cloud build trigger based
cloudbuild.yamlon release/push to branch, for continuous deployment and add substitutions for_LOCATION,_REPOSITORY, and_IMAGE.