Cloud Build enables you to create triggers on a GitHub Enterprise instance. This page explains how you can use GitHub Enterprise triggers to invoke builds in response to commits or pull requests from a GitHub Enterprise instance and and explains how you can build repositories from GitHub Enterprise if your instance is hosted in a private network.
Before you begin
Enable the Cloud Build, Secret Manager, and Service Networking APIs.
- Follow the instructions to connect a GitHub Enterprise host.
- Follow the instructions to connect a GitHub Enterprise repository.
Building repositories from GitHub Enterprise in a private network
If your GitHub Enterprise instance is hosted in a private network and not reachable over a public internet connection, you must create a private connection between your VPC network and the service producer network. You also need a private pool to build in a private network.
To create a GitHub Enterprise trigger to build in a private network:
Create a private connection between the VPC network and your service producer network by completing the following steps:
Allocate a named IP range in the VPC network. To use the VPC network with Cloud Build, your prefix length must be
/23or lower, such as
Establish a VPC network private connection between your VPC network and Google Cloud. To learn more, see Creating a private connection.
If you have DNS configured for your GitHub Enterprise instance, you need to manually peer your DNS zone to our service provider. To learn more, see the Sharing private DNS zones with service producers.
[OPTIONAL] If you do not want to create a private connection from your Cloud project, you can set up a Shared VPC and have your Cloud project use that network instead if your project is part of an organization. You will still need the Shared VPC to be peered to the network.
Create a GitHub Enterprise trigger to build repositories hosted on a GitHub Enterprise instance.
Your GitHub Enterprise trigger will now automatically invoke builds on your GitHub Enterprise instance based on your configuration. To learn how to run builds using a private pool, see Running builds in a private pool.
- Learn how to create and manage build triggers.