Warm tip: This article is reproduced from serverfault.com, please click

How to push code from Cloudways to Github

发布于 2018-11-29 03:58:32

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.

Questioner
user3752231
Viewed
11
VonC 2019-03-18 15:20:04

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:

  • Generating and downloading SSH keys
  • Uploading the SSH public key to your Git Repository
  • Copying the Repository SSH address
  • Deploying code from your Repository

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 to public_html/.
  • Finally, click on the Start Deployment button to deploy your code to the selected path.

https://support.cloudways.com/wp-content/uploads/2018/03/git-deploy-new1.png