Is it possible to deploy code from a Cloudways app to an empty git repository? I would like to know if it's possible as I'm currently using FTP (Filezilla) for that. I'm able to clone a live site to a staging site, but cannot deploy it to Github in order to work on the files on my local machine.
You should first make sure you can deploy your Cloudways application (that you have copied through filezilla locally) with Git, and pushed to a GitHub repo:
See "Deploy Code to Your Application Using Git".
Once your SSH access is setup, you can click "start deployment" to initiate the process. It will fetch the GitHub repo, and deploy it.
That means, to the question "Is it possible to deploy the code from a cloudways app to an empty git repository?": no, the publication process is the other way around.
That would involve:
The last step being:
- Back on Cloudways console, paste the SSH address you got in Step 4 into the Git Remote Address field and click on the Authenticate. This will ensure that there are no blockers in the communication between Cloudways and Git service (which is Github in our example) .
- Then choose the branch of your repository (master will be selected as default) you want to deploy from.
- Next, type the deployment path (i.e. the folder in your server where the code will be deployed). Make sure to end it with a
/
.
If you leave this field empty, the code will be deployed topublic_html/
.- Finally, click on the Start Deployment button to deploy your code to the selected path.
This deploys FROM github TO cloudways, which I have no problem doing. What I'm asking is if it's possible to get the files FROM cloudways TO github, which I can then pull to my local repository.
@user3752231 you can clone an app to a new server (support.cloudways.com/…): can you check if you can acess that new cloned repo on a new server? If yes, you should be able to clone it locally (before pushing it to GitHub) from that server ssh url.
I tried something like that, in that I cloned the live app to a staging app, not sure if I have the permissions to a new server, but If i did I still don't see any option for pushing it using Git. I'm just checking if possible with Git, their documentation doesn't mention it. If not then I can manage with ftp, then overwriting the staging files with the newly edited ones.
@user3752231 not pushing, but cloning first to your local PC, then pushing from your local PC to GitHub.
I am able to deploy my code from a Git repo to cloudways with no problems by the way