Adding a Project#
Add the project to Lagoon#
- 
Run this command: Add projectlagoon add project \ --git-url <YOUR-GITHUB-REPO-URL> \ --deploytarget 1 \ --production-environment <YOUR-PROD-ENV> \ --branches <THE-BRANCHES-YOU-WANT-TO-DEPLOY> \ --project <YOUR-PROJECT-NAME>- The value for --deploytargetis the ID of your Kubernetes cluster.
- Your production environment should be the name of the branch you want to have as your production environment.
- The branches you want to deploy might look like this: “^(main|develop)$”
- The name of your project is anything you want - “Company Website,” “example,” etc.
 
- The value for 
- 
Go to the Lagoon UI, and you should see your project listed! 
Add the deploy key to your Git repository#
Lagoon creates a deploy key for each project. You now need to add it as a deploy key in your Git repository to allow Lagoon to download the code.
- 
Run the following command to get the deploy key: 
- 
Copy the key and save it as a deploy key in your Git repository. 
Add the webhooks endpoint to your Git repository#
In order for Lagoon to be able to deploy on code updates, it needs to be connected to your Git repository
- 
Add your Lagoon cluster's webhook endpoint to your Git repository - Payload URL: <LAGOON-WEBHOOK-INGRESS>
- Content Type: JSON
- Active: Active (allows you to enable/disable as required)
- Events: Select the relevant events, or choose All. Usually push, branch create/delete are required
 
- Payload URL: