Skip to content

Instantly share code, notes, and snippets.

@grant
Created November 19, 2019 22:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grant/de2acedd094ec676d2d2822b3d350bae to your computer and use it in GitHub Desktop.
Save grant/de2acedd094ec676d2d2822b3d350bae to your computer and use it in GitHub Desktop.
YouTube API on Cloud Run – Deploy Script
# !/bin/bash
# Set env var "GCP_PROJECT" to our project name
GCP_PROJECT=$(gcloud config list --format 'value(core.project)' 2>/dev/null)
# Set our Cloud Run region (so we aren't prompted)
gcloud config set run/region us-central1
# Build and upload your image in Google Container Registry
gcloud builds submit --tag gcr.io/$GCP_PROJECT/yt
# Deploy your container to Cloud Run
ENV=$(cat .env)
gcloud run deploy --image gcr.io/$GCP_PROJECT/yt --platform managed --set-env-vars=$ENV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment