CorefinityCorefinityDocs
Open the Control PanelControl Panel
Code and deployments · 2 of 10

Connect a repository

Switch a site to Git deployments and choose the repository and branch it deploys from.

On this page

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

  1. 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.

  2. 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.

  3. Choose the repository and branch

    Choose Connect a repository… on the Deployment mode card. Choose the Provider, enter the Repository as owner/name and the Branch, then choose Save repository.

    Leave Deploy on push ticked to deploy every push to that branch. That also needs Create Deployments.

  4. 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

Connect a repository

Sets the repository and branch the site deploys, through one of the connections the settings list, and whether a push to the branch deploys.

PUT/api/corestack/sites/{site}/deployments/repository
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"
  }'
Was this helpful?
Open in ClaudeOpen in ChatGPT