If you want to host your code in a GIT repository that is not Github, BitBucket or some other large corporation whose Privacy Policy and Terms & Conditions you didn't read, cPanel can be a reasonable option. You will, however, have to set up the continuous deployment yourself. Using Microsoft Azure Web App Service as deployment destination example, here's how.
Credentials
You will need to authorise your requests when publishing code to Azure. We will use the publish profile file that is a one click download. We will also parse the file straight away, so that there's no need to fish out, copy and paste the values we're going to need.
- Go to your web app and click Download publish profile at the top of the blade. Upload it into your cPanel git repository root folder as
.PublishSettings. - Add
*.PublishSettingsto your.gitignore- cPanel won't trigger the deployment if there are uncommitted files in the repository.
Deployment instructions
You will need a .cpanel.yml file in your repository root. This file will orchestrate the whole deployment process.
Similarly to .PublishSettings above, make sure the file does not just sit there - either commit it to the repository, or .gitignore and upload it to the actual repository folder in cPanel. Else cPanel will not deploy.
Of all the options to deploy to Azure. we will use Zip Deploy via API which packages your code into a zip archive and pushes it to Azure. Azure will then unzip and build your project. That is unlike the similarly named Zip Package method, which mounts the archive it receives and expects its contents to be an already built application.
(We don't use the External Git method because that requires the repository to be available over HTTPs or SSH with username and password.)
---
deployment:
tasks:
- export ZIP="$HOME/tmp/deploy.zip"
- rm -f "$ZIP"
- zip -r "$ZIP" . -x ".git/*"
- export PS=.PublishSettings
- export URL=$(xmllint --xpath 'string(/publishData/publishProfile[@publishMethod="ZipDeploy"]/@publishUrl)' "$PS")
- export USER=$(xmllint --xpath 'string(/publishData/publishProfile[@publishMethod="ZipDeploy"]/@userName)' "$PS")
- export PASS=$(xmllint --xpath 'string(/publishData/publishProfile[@publishMethod="ZipDeploy"]/@userPWD)' "$PS")
- curl -X POST -u "$USER:$PASS" -T "$ZIP" "https://$URL/api/publish?type=zip"
The file packs up your repository into a ZIP archive, excluding the .git folder. It parses the required authentication values from the .PublishSettings file we uploaded earlier. Finally, it uploads the archive to an Azure endpoint.
Azure configuration
Instruct Azure to build your project - create the following environment variable:
SCM_DO_BUILD_DURING_DEPLOYMENT=true
This ensures Azure pulls the dependencies your projects may have listed.
More info: https://azureossd.github.io/2025/09/03/ENABLE_ORYX_BUILD-vs-SCM_DO_BUILD_DURING_DEPLOYMENT/