Deploy a project using Git push

后端 未结 19 936
囚心锁ツ
囚心锁ツ 2020-11-22 07:06

Is it possible to deploy a website using git push? I have a hunch it has something to do with using git hooks to perform a git reset --hard on the

19条回答
  •  一向
    一向 (楼主)
    2020-11-22 08:04

    In essence all you need to do are the following:

    server = $1
    branch = $2
    git push $server $branch
    ssh @$server "cd /path/to/www; git pull"
    

    I have those lines in my application as an executable called deploy.

    so when I want to do a deploy I type ./deploy myserver mybranch.

提交回复
热议问题