Git Deployment – Plesk

Appendix:

  • How to clone git repository to plesk.
  • How to change git branch.
  • How to enable auto deployment.

How to clone git repository to plesk.

  1. Go to the desired domain or sub domain.
  2. Click on Git icon (fig. 1.1).
  3. Click on Add Repository.
  4. Click on Remote Repository (fig. 1.2).
  5. Enter your git repository ssh link.
  6. Copy ssh key.
  7. Go to your git repository settings page (i.e github).
  8. Settings > Deploy Keys > Add New.
  9. For the title: enter a name to remember which this key refers to (i.e. serv50 or you can use the domain name sub.domain.com).
  10. Paste the ssh key that you copied from Plesk.
  11. Go to plesk again and submit the add repository form.
Fig(1.1)
Fig(1.2)
Fig(1.3)

Now your repository is linked to your domain. and your main branch is updated. If you want to manual pull from git click on Pull now.

How to change repository setting in plesk.

How to change the deployed branch.

In some cases you may need to change some settings like change the used branch.

  1. Go to the plesk repository settings.
  2. Select the desired branch from Repository branch select menu.
  3. Click Apply.

How to enable automatic deployment.

  1. Go to plesk repository settings
  2. Copy the webhook url.
  3. Go to your git provider repository settings (i.e. github).
  4. Go to webhooks.
  5. Click on Add webhook button.
  6. Paste the webhook url you copied before from plesk into the Payload URL field.
  7. Click on Add webhook.
  8. If your project require running some commands after pull from the server you will need to write the commands in bash script and call it something.sh
  9. In the Plesk repository setting click on enable additional deployment actions.
  10. write bash something.sh
  11. Click on Apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Select your currency
USD United States (US) dollar