Automated deployment with Google Compute Engine and Cloud Build


  • A server running on Google Cloud Compute Engine.
  • PM2 installed and running

What is CI/CD ?

CI/CD stands for Continuous Integration and Continuous Deployment.

The process

The pipeline will be as follow :

  • Push on Github main branch
  • Trigger from Google Cloud Build
  • Script executed
  • Code pulled on server & server restart

Create a file

The file is a bash script that will execute 2 tasks :

  • Pull code from Github repository
  • Restart PM2
sudo su roottouch sudo vim
chmod +x

Create a Google Source Repository

You need to have a Github repository to push code to the main branch.

YAML file

You might have noticed the cloudbuild.yml file in my repository.

Create a trigger

Short reminder of the process :

Verify the entire CI/CD process

When getting from we get “pong”



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Beranger Natanelic

Beranger Natanelic

Future Unicorn Founder — Using tech for good