Deploy cloud9 to digitalocean using git


#1

does anyone know how to deploy code from c9 to digitalocean using git? If so can you break down the steps for me, very difficult to find a solid solution on how this process is done.


#2

Hey @bvcxtds :slightly_smiling:,

The way I work with DigitalOcean with Cloud9 is just by creating an C9 SSH Workspace and working directly in the droplet. The SSH workspace will have better resources but you still have the full Cloud9 IDE and can still collaborate and everything. It’s my favorite way to work on C9.

See the official C9 doc on it at: Running your Own SSH Workspace.

This approach would be much less complex than pushing to git and then having DigitalOcean pull down the new code (which I guess you could code some GitHub webhooks and DigitalOcean’s API to do it). I recommend an SSH Workspace if you can do it this way under your circumstances, much simpler, more direct, faster.

Best,
Mike


#3

The method @mikeumus mentioned is definitely doable and will work. If you’d like to stick with just deploying via git then here’s a simplified version of how you might do it.

  1. Push code from workspace to repo
  2. SSH into DigitalOcean droplet
  3. Pull code from repo into appropriate folder

The appropriate folder I mention above will depend on what configuration/server you have running. Lots of people use Apache to serve their applications and that would be normally be in /var/www.


#4

@bradydowling @mikeumus thanks for helping guys!! I decided to deploy with git and went with https://gitlab.com/ free private repo for production work!!!


#5

Hi,

I know the issue is resolved, but there’s another way to do deployments which I personally really like. Here’s an excellent write-up about it from DigitalOcean.

Basically, this is very similar to how Heroku does it. You would set up a git hook on your DO droplet, and set it to place the repo to a certain folder in your machine (e.g. /var/www) and then you can simply do something like git push deploy master and it would work.

Enjoy! :slightly_smiling:

Regards,
​Mutahhir