Posts

Showing posts with the label google cloud run

Github CI/CD with Google Cloud Build

Image
Introduction Continuous Integration (CI) : This is the process of building, testing, and performing necessary actions to ensure code quality before it gets merged into the main branch for deployment. Continuous Delivery (CD) : This usually happens after CI and includes steps to deploy the source code to various environments like staging and production . This guide will show you how to set up CI/CD on Github using Google Cloud Build . While Github provides shared runners, if you or your organization have many jobs that need executing during development, setting up your own runner is a better choice. Before proceeding, you should understand some basics about Google Cloud Run to build and deploy Docker images. You can refer to this article for more details: Build Docker image for NodeJS Typescript Server . Setting Up GitHub CI/CD First, create a Github repository. You can choose either a public or private repository. You can use a NodeJS TypeScript application, following my guide o

Using Google Cloud Run to Deploy Docker Image

Image
Introduction Google Cloud Run (GCR) makes deploying a Docker image as easy as running it locally. GCR also includes customizable configuration options for managing services, simplifying the deployment process significantly. Build Docker Image The key step in deploying with a Docker image is successfully building that image. In this guide, we’ll use a NodeJS server Docker image created in this article . Follow the steps to build your Docker image (or use an existing one), and push it to Google Artifact Registry before proceeding. Deploy Docker Image To deploy a Docker image using Google Cloud Run , simply use the following command: gcloud run deploy express-ts --image {docker image} --port {port container} --region {region id} --max-instances {number of instance} --allow-unauthenticated --image : is the link to the Docker image on Google Artifact Registry or Docker Hub --port : is the container port you are exposing --max-instances : is the number of instances