DEV Community

Vikas Singh
Vikas Singh

Posted on

GCP to GitHub CI/CD Setup Steps

Which Should You Use?
GitHub Actions: More flexible if you already use GitHub workflows
Cloud Build: Better integration with GCP, especially for multi-service deployments

Step 1: Download Code from GCP to Local ,If code is on Compute Engine VM:

Step 2: Initialize Local Git Repository

Step 3: Create GitHub Repository
-Create new repo at GitHub.com
-Do not initialize with README
-Copy repository URL

Step 4: Connect to GitHub
Step 5: Enable GCP APIs
-Enable Cloud Build API
-Enable Cloud Build GitHub App

Step 6: Connect GitHub to Cloud Build
-Go to Cloud Build → Triggers
Click Connect Repository
Choose GitHub (Cloud Build GitHub App)
Authenticate and select repository

Step 7: Create Cloud Build Trigger
Step 8: Create cloudbuild.yaml File for app engine, cloud run
and cloud storagae.

Step 9: Test Automation
Step 10: Verify Deployment
-Check Cloud Build → History
-Wait for green checkmark
-Verify live site updated

Step 11: Set Permissions
Ensure Cloud Build service account has:

App Engine: App Engine Admin role
Cloud Run: Cloud Run Admin role
Cloud Storage: Storage Admin role

Top comments (0)