Netlify deploy and netlify deploy --prod not showing changes

I have a site set up to use netlify and via a github source.

I’m finding that when pushing through github, “git push origin master” is deploying to netlify just fine and I can see all of the changes I have made, including the successful build status in github and netlify.

however running “netlify build” or “netlify build --prod” isn’t showing any changes.

netlify status looks fine, the only mismatch I can see is;

On netlify, within deploy settings;
my Build command is: npm run build

In my netlify.toml file;
it is also set to: command = “npm run build”

Should this not be set in both cases to “netlify build”?

@SimonPhilpott, welcome to the community!

Regarding your question, no, you shouldn’t set the netlify cli as your build command since netlify build runs what you have as your build command. You’re good to leave it.

That said, note that netlify build only builds your site. If you wish to deploy it, you’ll need to run netlify deploy. This is mentioned here: cli/deploy.md at main · netlify/cli · GitHub. Let me know if that helps.

Hi thanks for coming back to me, it was a bit of a mistake in my original post. I’m using Gatsby as part of my stack, which used the “Gatsby build” command. Even so I’m finding that changing the build commands in either the netlify.toml file, the deploy settings OR both to either “npm run build” or “Gatsby build” isn’t fixing the issue either.

Both “netlify deploy” and “netlify deploy --prod” are not reflecting the latest changes on my local build, both are completing successfully in the terminal with no error messages and I can also see the builds are successful in the deploy view on netlify. The urls’s produced however show a very old view of my site.

Only going through;
git add .
git commit -m “whatever”
git push origin master (or my branch)

seems to actually reflect the latest updates.

Right, found it.
In my package.json file there was a string that was blocking netlify build from working,
“build”: “GATSBY_EXPERIMENTAL_PAGE_BUILD_ON_DATA_CHANGES=true gatsby build --log pages”

I removed the below and netlify build successfully completed and so did netlify deploy.
GATSBY_EXPERIMENTAL_PAGE_BUILD_ON_DATA_CHANGES=true

EDIT: AAArgh. no not that. Netlify Deploy still doesn’t show recent changes.

Hey @SimonPhilpott,
A few followup questions! Was this working originally and then it broke or netlify deploy was never working as a deploy method? If the second one, maybe your project is not linked to your Netlify site yet, in which case you’ll want to link it with netlify link: cli/link.md at main · netlify/cli · GitHub

If that’s not the issue, would it be possible for you to share the repo with us so we can try to reproduce what you’re experiencing?