Plesk provides an quick configuration to setup automatic deployment for your application using your favorite code repo platform such as Github, Gitlab or Bitbucket without having a need to write YAML files for deployment. In this case, I reserve those for running other tasks such as tests.
Here is how to setup Plesk and Github for your auto deployment
/httpdocs/public
but deployment will be on /httpdocs/
directorySettings --> Deploy Keys
Settings --> Webhooks
That's it! Now, every time you push to master/main
branch, your application will be updated.
You can also create multiple deployments for different branches
You can also add addition post deployment commands in Plesk under Repository Settings by checking Enable additional deploy actions and entering commands, one per line.
The common cause of delivery fail is a misconfigured server. Your Plesk account must be accessible on https://yourdomain.com:8443 and should be secured using SSL.
Your hostname should be yourdomain.com
To correctly configure this, go to Tools & Settings --> Server Settings and enter yourdomain.com in Full Hostname
Now your webhook under Git Repository Settings should look like this
https://yourdomain.com:8443/modules/git/public/web-hook.php?uuid=aa89385e-4343-d3d2-22c9-900fc3e899b6
Update Github webhook if this has changed.