I'm at wits end with this. I have 2 cPanel domains (environments). One for staging and one for production. I have a cPanel remote repo that I can push to based off my local repo's staging branch and I have another cPanel remote repo for production which would push based off my master branch.
The problem here is, because the .cpanel.yml file needs to be CHECKED OUT in the repo, I can't just push to the remote repo and be done with it. I have to keep updating the deploy path each time I want to push to either staging or master in order for it to copy to the correct document root. This is not ideal and creates a high risk.
Does anyone out there have a good way of doing this? Because the file needs to be checked out in the repo, it can't just live at the folder's root on the server and uncommitted elsewhere. This would solve the problem as I could have separate .cpanel.yml files on my staging server and production server and not have to commit the file. I've done tons of reading and there seem to be no good solutions for handling cPanel staging and production environments from a single, local repo using branches as deploy points.
Has anybody successfully done this in a way that makes sense? Perhaps there are some env variables that can discern what the .config.yml should do based off the branch? Is there a way to make the .cpanel.yml function without it being checked out? I'm sick of dealing with this.
The problem here is, because the .cpanel.yml file needs to be CHECKED OUT in the repo, I can't just push to the remote repo and be done with it. I have to keep updating the deploy path each time I want to push to either staging or master in order for it to copy to the correct document root. This is not ideal and creates a high risk.
Does anyone out there have a good way of doing this? Because the file needs to be checked out in the repo, it can't just live at the folder's root on the server and uncommitted elsewhere. This would solve the problem as I could have separate .cpanel.yml files on my staging server and production server and not have to commit the file. I've done tons of reading and there seem to be no good solutions for handling cPanel staging and production environments from a single, local repo using branches as deploy points.
Has anybody successfully done this in a way that makes sense? Perhaps there are some env variables that can discern what the .config.yml should do based off the branch? Is there a way to make the .cpanel.yml function without it being checked out? I'm sick of dealing with this.
Last edited: