I'm working on a project and now is the stage of deployment. I have a droplet in digital ocean and I could just clone my git repository from bitbucket inside this droplet and every time I do a git push to my remote repository I just do a git pull inside my droplet. I really don't want to do this every time, so I searched how could I automate this and I found two ways:
Git hooks https://macarthur.me/posts/deploying-code-with-a-git-hook In this link show how to do it (I don't like the fact the after clone my git repository from bitbucket I have also to remote link with my droplet)
Pipeline Using BitBucket Pipelines to Deploy onto VPS via SSH Access I also find this way that I just do my git pull inside my pipeline
So here is my question: between these two ways, which one is better? The only thing that I don't like in the git hooks way is that every time I clone my bitbucket repository in a new machine, I have to add new remote repository to automate the deployment.