Deploying via Git

Sorry to revive an old topic if it’s not relevant anymore… I use the post-receive hook method @BenSeitz described and it’s very fast and reliable in my experience. As @dinko pointed out, doing that makes you deploy on the production server git-related stuff which some people might not want to do since it uses disk space unnecessarily on the production server, and as you also pointed out, it doesn’t sync the other way around to reflect content changes on the production server to a remote repo (that just happens to not be a problem for me since there is no direct modification of content on the production server in my workflow – this however seems to be discussed here), but what i’m wondering about is if i really need to also have a post-receive hook (as i do) for each of the core, toolkit and panel repos. When i update the infrastructure, i have to push 3 git repos to the production server via those hooks. Is there a better way? It’s not an issue for me since i’m just doing that a couple times a year, and on one server. I’m just curious to understand if i’m doing something stupid :blush:

EDIT: i just found this thread in the forum which seems to say that pushing just once taking submodules into account is not totally straighforward if you want to separate the repos from the work tree on the production server… I also second @Mattrushka’s idea that a ‘small & simple deployment guide for Kirby’ would probably be helpful.

I’m still using my rsync process and I’m very happy with it. I haven’t tried any of the other suggested tools…I meant to but I guess my motivation wasn’t high enough because I’m happy with my process.

Whatever way you choose, I think it’s useful to not deploy all files and folders you have in dev mode. I think it’s good to have some sort of build process with grunt, gulp, custom scripting or whatever you like.

As far as content backup is concerned – @texnixe, rsync can do this, either manually or automatically with some sort of cron task. You could also zip or tar your target files and folders and scp them somewhere. Lots of options – tyranny of choice :wink:

Edit: forgot to mention that you obviously need ssh for rsync to work. While more and more providers offer ssh access, clients may only have simple webspace with ftp access.

I’m looking for the best way to deploy kirby sites to my server, this guide seems a good way to do it, however, I have some questions.

Ideally I’d like changes to the content that are made on the server through the panel to be saved/backed-up to a another remote server. Would using the Auto-Git to a private GitHub repo be safe/recomended?

If this is the case, what other items should I be putting in the .gitignore? As, from what I understand I’ll have two git repos.

.DS_Store
/site/accounts
/assets/avatars
/assets/scss
/thumbs/*
/node_modules
/bower_components