Netlify site won't update when new github commit

Hello,

I have the following problem:
I have created a new Netlify site by using API. The site is supposed to connect to my private github repo. Everything goes well and the Netlify site is built successfully based on the github repo. The problem is that if I update a file or I create a new file on the git repo, Netlify will not deploy automatically the changes.

My Netlify site is: https://flawlesstest438291.netlify.app/

The API payload i’m using to create the Netlify site (something might be wrong here or something is missing):
{“name”: projectName, “repo”: {“provider”: “github”, “repo”:“gituser/gitrepo”, “private”: True, “branch”:“main”, “dir”:“/”, “deploy_key_id”:publicKeyId}, “build_settings”: {“repo_branch”:“main”, “dir”: “/”, “cmd”:“npm run build”, “deploy_key_id”: publicKeyId}}

What am I doing wrong or what am I missing?

Thank you!

Hi,

you have it configured to github yes via continuous deployment? Have you tried unlinking and relinking your github repo to Netlify and see if automatic deploys will work then?

Hi, SamO!

Thank you for your reply!

Yes, it is configured via continuous deployment. The solution of unlinking and relinking, even if it works, it doesn’t work for me since I want this to be done 100% by my script via API.

I figured it out.

It is all about creating a build hook that github calls when there is a new commit on the repo.

Everything can be done programatically, without any problems.

What I fail to understand is why this is needed. When you create a site via the UI, there is no need to create build hooks or deploy keys (in this case, for private repos).

Netlify does this for you.