You can have the code of your Node.js app fetched from a Git repository. With a webhook, the app deploys automatically on every push.
Steps
- Go to Websites and open the website.
- Go to Website › Node.js.
- Under Source of the code, choose Git repository.
- Enter the Git address and the Branch and click Save.
- Under Deploy key, click Make a deploy key. Add the key to your repository, under the deploy keys, with read-only access.
- Click Deploy to fetch the first version.
- For automatic deploys: under Deploy automatically on a push, click Make a secret. In your repository, create a webhook for push events with the URL and the Secret from the panel.
Good to know
- Only pushes to the chosen branch are deployed.
- You can also fetch a public repository through an https address, without a deploy key.