DEV Community

Vikas Singh
Vikas Singh

Posted on

Part 2: Steps for a site Development

5. Automated deployment Setup
5.1 Create GitHub Actions Workflow
Create .github/workflows/deploy.yml:

5.2. Alternative: Using Cloud Build
Create cloudbuild.yaml in project root:


6.GCP Infrastructure setup
6.1. Create Storage Bucket

  • Create bucket
  • Configure as website
  • Make files publicly accessible

6.2. Set Up Load Balancer (For Custom Domain)
Create HTTP(S) Load Balancer
Add bucket as backend
Configure SSL certificate

7.Connect GitHub with GCP
7.1. Create Service Account
Go to IAM & Admin > Service Accounts
Create new service account
Add roles: Cloud Build Editor, Storage Admin

7.2. Generate and Add Secrets to GitHub

  • Create JSON key for service account
  • Add to GitHub Secrets:

GCP_SA_KEY = Service account JSON
GCP_PROJECT = Project ID
GCP_BUCKET_NAME = Your bucket name

8.Domain Configuration (If Using Custom Domain)
8.1. DNS Configuration
8.2. SSL Certificate
Use Google-managed SSL certificate
Update load balancer with domain

9.Testing the Pipeline
9.1. Make a Test Change

9.2. Monitor Deployment
Check GitHub Actions tab
Verify Cloud Build logs
Test live site

10.Ongoing Development
Workflow for Changes:
Make changes locally
Commit and push to GitHub
GitHub Actions automatically:
it Builds React app
it Deploys to GCP Storage
Changes go live in 2-5 minutes

Top comments (0)