7
I still can’t figure out which is the best deploy on a site. I explain how I’m doing:
GIT
- I started a local repository
- I hosted my repository on some service like Github/Bitbucket
- I hacked into the server via SSH and clone the direct repository of that service
- Whenever I update the site on my PC (local), I give a PUSH again pro Github/ Bitbucket, enter the hosting site via SSH and give a PULL to update the files.
This way I can keep everything versioned without needing FTP and I think fast. But this is a good practice to deploy with GIT?
GULP
Already with GULP the thing changes a little. There are two folders: dist which is the "production" or deploy folder as I understand it; and the folder app which is the folder I’m working on, development folder.
If I deploy with GIT, is there a way to CLONE only the DIST folder on the server via SSH? And if you deploy with GULP via FTP, it would be a good practice?
I know (or think I know) how to deploy both ways, but I wanted to understand a more correct practice of doing this. I use GIT to promote my projects and wanted to use GULP, but I don’t know if I should see both folders (dist and app).
So Israel, in the case of Gulp the app folder is where the source of the project is and it is it that you must Convert the dist folder has no need for versioning since it is the deploy, it just needs to publish even...
– Roberto Ramos
You can use a git post-receive hook to generate dist using Gulp as soon as you receive it on the server. So you can keep dist out of versioning and decrease file transfer load.
– rodorgas
Additionally, you can set up a webhook on github to update your server automatically. So you don’t need to access the server via ssh every time you change the code.
– rodorgas