Forums

Best approach to automate deployment

I currently have to log in to bash prompt and do git pull in latest changes. How do I make it so changes get pulled in automatically whenever there is merge into the main branch.

I guess I could have a cron that just keeps doing git pull every 1 minute but that seems like a bad way to do it. Is there an API or something that can do this? Thank you!

If you're using GitHub, you could use their webhooks to hit your site when the repo is updated, and then do a git pull from the view function that handles that -- this blog post has some ideas on how to do that.