From claude-commands
Guides finding GCP Cloud Run services for Your Project via Cloud Console, gcloud CLI, and repo scripts; covers dev/staging/prod deployments and URLs.
npx claudepluginhub joshuarweaver/cascade-code-general-misc-2 --plugin jleechanorg-claude-commandsThis skill uses the workspace's default tool permissions.
**Purpose**: Guide for finding GCP Cloud Run services and deploying Your Project
References GCP Cloud Run deployments for worldarchitecture-ai project: dev/stable/staging service URLs, revisions, statuses, recent git commits, and CSS rate limit issue history.
Interactively sets up GCP Cloud Build + Cloud Run infrastructure. Provisions APIs, Artifact Registry, service accounts, IAM, secrets, and triggers with security best practices.
Guides secure deployments to Google Cloud Storage (static apps), Cloud Run, or GKE (dynamic/container apps) after analyzing app type via package.json and enforcing secret scanning.
Share bugs, ideas, or general feedback.
Purpose: Guide for finding GCP Cloud Run services and deploying Your Project
โ ๏ธ IMPORTANT: This skill is ONLY for the Your Project repository and GCP project. The deployment scripts, service names, and configurations are specific to this project and will not work for other repositories or GCP projects.
Repository: https://github.com/jleechanorg/your-project.com
Project: Your Project
GCP Project ID: worldarchitecture-ai (specific to this project only)
Region: us-central1
Platform: Google Cloud Run (containerized deployments)
Scope: All commands, scripts, and service references in this document are specific to the worldarchitecture-ai GCP project and will not work with other GCP projects or repositories.
| Environment | Service Name | URL |
|---|---|---|
| Production | mvp-site-app-stable | https://mvp-site-app-stable-i6xf2p72ka-uc.a.run.app |
| Staging | mvp-site-app-staging | https://mvp-site-app-staging-i6xf2p72ka-uc.a.run.app |
| Development | mvp-site-app-dev | https://mvp-site-app-dev-i6xf2p72ka-uc.a.run.app |
| PR Preview | mvp-site-app-s1 through s10 | Rotating pool (see PR Preview section below) |
Add /health to any service URL:
Navigate to Cloud Run:
https://console.cloud.google.com/run?project=worldarchitecture-ai
Filter by service name: Look for mvp-site-app* services
View service details: Click on any service to see:
# List all Cloud Run services
gcloud run services list \
--project=worldarchitecture-ai \
--region=us-central1
# Get specific service details
gcloud run services describe mvp-site-app-stable \
--project=worldarchitecture-ai \
--region=us-central1 \
--format=yaml
# Get service URL
gcloud run services describe mvp-site-app-stable \
--project=worldarchitecture-ai \
--region=us-central1 \
--format="value(status.url)"
The deployment script automatically determines the correct service:
# Check what will be deployed
cat scripts/deploy_common.sh | grep -A 10 "SERVICE_NAME="
Service naming pattern:
mvp-site-app-devmvp-site-app-stagingmvp-site-app-stableNeed to deploy?
โโ Production/Stable? โ Use GitHub Actions (Required)
โโ Staging? โ Use ./deploy.sh staging (local deployment)
โโ Development? โ Use ./deploy.sh (local) OR auto-deploys on push to main
Development (Default):
./deploy.sh
# OR explicitly
./deploy.sh mvp_site
Staging:
./deploy.sh mvp_site staging
Production (BLOCKED locally):
./deploy.sh mvp_site stable
# โ This will fail with safety message directing you to GitHub Actions
Auto-detection: The script automatically detects deployable apps if run from project root:
# If current directory has Dockerfile, uses current directory
# Otherwise shows interactive menu of available apps
./deploy.sh
Via CLI:
# Trigger production deployment
gh workflow run deploy-production.yml \
-f confirm_production="DEPLOY TO PRODUCTION"
# Check deployment status
gh run list --workflow=deploy-production.yml --limit 1
gh run view <run-id>
Via GitHub Web UI:
Why GitHub Actions Required for Production:
Development environment auto-deploys when code is pushed to main branch:
Workflow: .github/workflows/auto-deploy-dev.yml
Trigger:
git push origin main
# Automatically triggers deployment to dev environment
Check auto-deploy status:
gh run list --workflow=auto-deploy-dev.yml --limit 3
./deploy.shLocation: Project root Purpose: Context-aware deployment with auto-detection
Usage:
./deploy.sh [TARGET_DIR] [ENVIRONMENT]
Examples:
# Deploy from current directory to dev (if Dockerfile exists)
./deploy.sh
# Deploy specific app to dev
./deploy.sh mvp_site
# Deploy to staging
./deploy.sh mvp_site staging
# Attempt production (will be blocked)
./deploy.sh mvp_site stable
Environment Mapping:
dev (default): Development environmentstaging: Staging environmentstable, prod, production: Production (GitHub Actions only)scripts/deploy_common.shPurpose: Shared deployment logic Contains:
Service Name Logic:
if [[ "$ENVIRONMENT" == "stable" ]]; then
SERVICE_NAME="mvp-site-app-stable"
elif [[ "$ENVIRONMENT" == "staging" ]]; then
SERVICE_NAME="mvp-site-app-staging"
else
SERVICE_NAME="mvp-site-app-dev"
fi
Current Settings (all environments):
Why 6 instances:
deploy.sh (MAX_INSTANCES variable)Set via GCP Console:
Common variables:
GEMINI_API_KEY: Google Gemini API keyFIREBASE_CREDENTIALS: Firebase service account JSONBuild timeout: 10 minutes (configurable)
Build logs: Streamed to terminal during deployment
Build configuration: Defined in Dockerfile in target directory
Via Console:
# Production logs
https://console.cloud.google.com/logs/query?project=worldarchitecture-ai&query=resource.type%3D%22cloud_run_revision%22%0Aresource.labels.service_name%3D%22mvp-site-app-stable%22
# Staging logs
https://console.cloud.google.com/logs/query?project=worldarchitecture-ai&query=resource.type%3D%22cloud_run_revision%22%0Aresource.labels.service_name%3D%22mvp-site-app-staging%22
# Dev logs
https://console.cloud.google.com/logs/query?project=worldarchitecture-ai&query=resource.type%3D%22cloud_run_revision%22%0Aresource.labels.service_name%3D%22mvp-site-app-dev%22
Via gcloud CLI:
# Stream production logs
gcloud run services logs read mvp-site-app-stable \
--project=worldarchitecture-ai \
--region=us-central1 \
--limit=50
# Follow logs in real-time
gcloud run services logs tail mvp-site-app-stable \
--project=worldarchitecture-ai \
--region=us-central1
# Production health check
curl https://mvp-site-app-stable-i6xf2p72ka-uc.a.run.app/health
# Staging health check
curl https://mvp-site-app-staging-i6xf2p72ka-uc.a.run.app/health
# Dev health check
curl https://mvp-site-app-i6xf2p72ka-uc.a.run.app/health
Expected response:
{
"status": "healthy",
"timestamp": "2025-11-14T18:35:44Z"
}
Local deployment blocked:
./deploy.sh mvp_site stable
# Output:
# ๐จ PRODUCTION DEPLOYMENT BLOCKED ๐จ
# Production deployments are NOT allowed from local machines for safety.
GitHub Actions protection:
productionPre-deployment checks:
Post-deployment checks:
GCP Authentication:
# Login to GCP
gcloud auth login
# Set project
gcloud config set project worldarchitecture-ai
# Verify authentication
gcloud auth list
Authentication: Workload Identity Federation
Service Account: github-actions@worldarchitecture-ai.iam.gserviceaccount.com
Configured in: .github/workflows/*.yml
Secrets required:
GCP_WORKLOAD_IDENTITY_PROVIDER: Workload identity providerGCP_SERVICE_ACCOUNT: Service account email# 1. Trigger deployment
gh workflow run deploy-production.yml \
-f confirm_production="DEPLOY TO PRODUCTION"
# 2. Monitor deployment
gh run list --workflow=deploy-production.yml --limit 1
# 3. View detailed logs
gh run view <run-id>
# 4. Verify health
curl https://mvp-site-app-stable-i6xf2p72ka-uc.a.run.app/health
# Local deployment (staging uses local deployment only)
./deploy.sh mvp_site staging
# Option 1: Local deployment
./deploy.sh mvp_site
# Option 2: Push to main (auto-deploys)
git push origin main
# Option 3: Manual GitHub Actions trigger
gh workflow run auto-deploy-dev.yml
# List all services
gcloud run services list \
--project=worldarchitecture-ai \
--region=us-central1
# Get specific service status
gcloud run services describe mvp-site-app-stable \
--project=worldarchitecture-ai \
--region=us-central1
# Check recent deployments
gh run list --workflow=deploy-production.yml --limit 5
# List revisions
gcloud run revisions list \
--service=mvp-site-app-stable \
--project=worldarchitecture-ai \
--region=us-central1
# Route traffic to previous revision
gcloud run services update-traffic mvp-site-app-stable \
--to-revisions=<REVISION-NAME>=100 \
--project=worldarchitecture-ai \
--region=us-central1
Check build logs:
# View recent Cloud Build logs
gcloud builds list \
--project=worldarchitecture-ai \
--limit=5
# Get specific build details
gcloud builds describe <BUILD-ID> \
--project=worldarchitecture-ai
Check service status:
gcloud run services describe mvp-site-app-stable \
--project=worldarchitecture-ai \
--region=us-central1 \
--format=yaml
Check logs:
gcloud run services logs read mvp-site-app-stable \
--project=worldarchitecture-ai \
--region=us-central1 \
--limit=100
Local:
# Re-authenticate
gcloud auth login
gcloud auth application-default login
# Verify project
gcloud config get-value project
GitHub Actions:
./deploy.shscripts/deploy_common.sh.github/workflows/deploy-production.yml.github/workflows/auto-deploy-dev.ymlPR preview deployments are automatically created for pull requests via the "Deploy PR Preview (Rotating Pool)" workflow. These deployments use a rotating pool of services (mvp-site-app-s1 through mvp-site-app-s10) to provide isolated preview environments for testing PR changes.
Get URL from latest PR preview deployment:
# Get the latest PR preview deployment run
RUN_ID=$(gh run list --workflow="Deploy PR Preview (Rotating Pool)" --limit=1 --json databaseId -q '.[0].databaseId')
# Extract deployment URL from logs
gh run view --log "$RUN_ID" | grep "PREVIEW_URL:" | grep -oE "https://[^[:space:]]+\.run\.app"
Get URL for specific PR:
# Find deployment run for PR #3490
gh run list --workflow="Deploy PR Preview (Rotating Pool)" --limit=50 --json databaseId,displayTitle | \
python3 -c "import sys, json; runs = json.load(sys.stdin); \
matches = [r for r in runs if '3490' in r.get('displayTitle', '')]; \
print(matches[0]['databaseId'] if matches else 'No matching runs found')"
# Then get URL from that run's logs
gh run view --log <RUN_ID> | grep "PREVIEW_URL:"
Note: If no matching runs are found, increase the
--limitvalue or verify the PR number. The defensive Python snippet above will print "No matching runs found" instead of raising anIndexError.
List all PR preview services:
gcloud run services list \
--project=worldarchitecture-ai \
--region=us-central1 \
--filter="name:mvp-site-app-s*" \
--format="table(name,status.url,metadata.labels.`pr-number`)"
Get URL for specific PR:
# Find service for PR #3490
gcloud run services list \
--project=worldarchitecture-ai \
--region=us-central1 \
--filter="metadata.labels.`pr-number`=3490" \
--format="value(status.url)"
Get URL for specific service (e.g., s8):
gcloud run services describe mvp-site-app-s8 \
--project=worldarchitecture-ai \
--region=us-central1 \
--format="value(status.url)"
PR preview deployments automatically post comments on the PR with the deployment URL. Check the PR's comment thread for the deployment link.
mvp-site-app-s{1-10}mvp-site-app-s8 (for PR #3490)pr-number label indicating which PR it's currently serving# Check if PR has a preview deployment
gh pr view <PR_NUMBER> --json number,headRefName
# List recent PR preview deployments
gh run list --workflow="Deploy PR Preview (Rotating Pool)" --limit=10
# View specific deployment run
gh run view <RUN_ID> --log | grep -E "(PREVIEW_URL|Service URL|Deployment URL)"
# Health check for s8 (example)
curl https://mvp-site-app-s8-i6xf2p72ka-uc.a.run.app/health
# Or get URL dynamically
S8_URL=$(gcloud run services describe mvp-site-app-s8 \
--project=worldarchitecture-ai \
--region=us-central1 \
--format="value(status.url)")
curl "${S8_URL}/health"
pr-number label to confirm which PR a service is currently servingLast Updated: 2026-01-12 Version: 1.1