Automatically Deploy From GitHub To Server On Push

后端 未结 6 1651
陌清茗
陌清茗 2020-12-02 11:23

We have a VPS on linode, and code hosted on gitHub. How do we setup so when we push to gitHub, it also pushes automatically to our linode server. We are using PHP on the lin

6条回答
  •  失恋的感觉
    2020-12-02 11:58

    You may refer to this tutorial:
    Automatically Updating Your Website Using GitHub's Service Hooks:

    In short it explains the following steps:

    Create a php file in .git folder on your server with the following contents.

    
    

    Setup your server for the SSH keys to exist. Something like:

    key. cat ~/.ssh/id_rsa.pub
    

    Setup the service hook on GitHub . Enter WebHook URL:

    http://your.domain.com/path/to/yourfile.php
    

    When all is set. The file is going deploy all the work on your server each time you push to GitHub.

提交回复
热议问题