In this article we will learn how to create a CI/CD pipeline on GCP using Cloud Build, Github, and Docker.
For this article I will be using this repository.
First we would need to navigate to Code Build. Select the
Triggers tab in the sidebar and
Enter the name of your trigger and select
Connect new repository in the Source section:
You will see a sidebar that will appear on the right hand side with different options for repositories supported by Cloud Build. I am using Github, so I selected the first option. Click
You will be asked to authorize Cloud Build to access your github account and repositories:
Select your github account and repository for this trigger:
Then select the
Dockerfile in the Configuration section and hit Create at the bottom of the page:
You should see your newly created trigger with the connected repo:
Let's test our trigger by running it manually first.
Next to your trigger there is a button
A sidebar will popup on the right hand side asking you to confirm the details of deployment. Press
I can see the new image in the Container Registry. Mine is called
github.com. But it is there. The trigger is working!
And finally, let's push new code to the repository and test the trigger for automatic build.
I will let reader do the code pushing.
If you want to see current or past builds, Code Build has a section called
History in the sidebar on the left. It is a great to monitor builds.
When I pushed new code to my repository a new build was triggered right away and it appeared in the
That's it! Thank you for reading.