With this particular workflow focused on deploying applications to Google Cloud Run. The workflow is triggered on pushes to the develop
branch.
The Deploy Cloud Run to Dev Environment
workflow consists of several steps:
- Authentication : Authenticates with Google Cloud using the provided credentials.
- Set up Cloud SDK : Sets up Google Cloud SDK with the specified project ID and exports default credentials.
- Build and Push Image to GCP Artifact Registry : Builds the Docker image and pushes it to the specified Container Registry URL.
- Deploy on Cloud Run : Deploys the image to Google Cloud Run on the specified target service, port, region, and with the given service account.
To utilize this workflow:
- Define the required inputs in your GitHub repository's secrets or in the workflow file.
- Place this workflow file in your repository under
.github/workflows
. - Trigger the workflow based on your GitHub Actions settings (e.g., on push, pull request, or manually).
This workflow streamlines deploying applications to Google Cloud Run by automating various operations, ensuring consistency and reducing the likelihood of errors in deployments.
GCP_CREDENTIALS
: Google Cloud credentials JSON (required).GOOGLE_PROJECT
: Google Cloud project ID (required).CR_URL
: Container Registry URL (required).ARTIFACT_FOLDER
: Artifact folder in the container registry (required).IMAGE_NAME
: Image name (required).TARGET_SERVICE
: Target service for deployment (required).PORT
: Port number (required).REGION
: Google Cloud region (required).SA_MAIL
: Service account email (required).