- Google Cloud Platform
- Node.js version 20.9.0
- Express.js
- Firebase
- Docker
- Postman
Since we are using Firebase & Cloud Firestore in GCP services, we need to configure The Firebase Admin SDK to interact with Firebase from our local environment. To set GOOGLE_APPLICATION_CREDENTIALS environment variable you can follow these steps at the following link: https://firebase.google.com/docs/admin/setup#initialize_the_sdk_in_non-google_environments
- Clone repository
git clone https://github.com/Bangkit-2023-Capstone-CH2-PS307/CC.git
- Install dependencies
npm install
- Build and run the project
npm run dev
Navigate to http://localhost:8080
We published our API documentation from Postman, you can view it here
To perform automatic deployment to Cloud Run, we use GitHub Actions to Set up the gcloud CLI/SDK, Build and store a Docker Image to the Artifact Registry, then use the Docker Image from the Artifact Registry deployed to Cloud Run, you can see the full configuration in cloud-run.yml.
- You can create service account credentials at the following link: https://cloud.google.com/iam/docs/service-accounts-create
- Grant these role to work with GitHub Actions
- Artifact Registry Administrator
- Artifact Registry Writer
- Cloud Run Admin
- Editor
- Service Account User
- Storage Admin
- Then, create a service account key at the following link: https://cloud.google.com/iam/docs/keys-create-delete
- Download and secure the key. Don't lose it!
- You can read about GitHub Actions secrets and variable at the following link: https://docs.github.com/en/actions/learn-github-actions/variables
- Under GitHub Repository secrets, add these secrets:
- CLOUD_RUN_SERVICE_NAME (Your Cloud Run service name)
- GCP_CREDENTIALS (Your GCP Service Account Credentials)
- PROJECT_ID (Your GCP Project ID)
- REGION (Your deployed Cloud Run region)
- That's all. Just push the code changes to your main branch. And Boom!!!, you can check your Cloud Run deployment url in Google Cloud Console.