Connect a repository
Switch a site to Git deployments and choose the repository and branch it deploys from.
Before you start
- You are an owner, or your role has Manage Deployment Source and Manage Deployment Repositories.
- Your organisation's GitHub, GitLab or Bitbucket account, or your own GitLab server, is connected: see Repository connections.
- The site keeps serving while it switches. On a Laravel site the application rebuilds once, and visitors may see an error page until it finishes.
Connect the repository
Open the site's deployments
Go to Managed Websites, choose the site, then Deployments under Code & backups. Choose the button Switch to Git deployments… on the Deployment mode card.
Switch to Git deployments
How deployments work here shows what moves: your current files become release 1, and uploads and configuration move to
shared/. Choose Continue, then Switch to Git deployments to confirm.Choose the repository and branch
Choose Connect a repository… on the Deployment mode card. Choose the Provider, enter the Repository as
owner/nameand the Branch, then choose Save repository.Leave Deploy on push ticked to deploy every push to that branch. That also needs Create Deployments.
Deploy the site
Choose Deploy in the site's header, or push to the branch. Until the first deployment the site runs its current files unchanged.
Deployment mode reads Deploys from Git, with the repository, the branch and Deploy on push. Use Change repository… to pick another.
Automate this
Sets the repository and branch the site deploys, through one of the connections the settings list, and whether a push to the branch deploys.
curl -X PUT https://manage.corefinity.com/api/corestack/sites/1042/deployments/repository \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"auto_deploy": false,
"branch": "main",
"connection_id": 4217,
"contents": "site_content",
"repo": "northwind-digital/harbourandfinch",
"target_path": "wp-content/themes"
}'Your assistant calls corestack_deployments_repository_set.
{
"name": "corestack_deployments_repository_set",
"arguments": {
"site_id": 4211,
"connection_id": 12,
"repo": "corefinity/example-shop",
"branch": "main",
"auto_deploy": false
}
}