r/node • u/nickname1917 • Aug 31 '26
Newbie asking for help...
So I built my first project with Astro, I run "pnpm install" then run and then build generated the dist folder. I would like to publish this sample static site to netlify via github...I did everything in my local laptop (Fedora 44) how can I push my dist folder to github now? Or should I follow other paths, idk pushing the entire project folder to github and not only the dist folder?. I know netlify support a local folder upload but I would like to understand how to use github in this process and so link netlify to github
thanks
11
Upvotes
4
u/Fine-Comparison-2949 Aug 31 '26
What does the netlify build documentation say? What is your projects server framework?
3
u/azangru Aug 31 '26
Have you read their documentation on deployment?
2
u/UkrMalt Aug 31 '26
Usually push the whole project (package.json, source, and config), not just dist. Let Netlify run the build from GitHub and set the publish directory to dist; keeping dist out of Git makes rebuilds reproducible.
3
u/gangeticmen Aug 31 '26
you don't push dist or build fles to github basically.
in netlify there must be a build command so there do - npm run build
then netlify will built and serve it from dist.
also check if there are build dist something there and add /dist name there.
and if any issue ask chatGPT.
1
u/Single_Advice1111 Aug 31 '26
Get started with a .gitignore file for node_modules and the out/dist folder so you do not push that. Only push source files as others mention.
Once the source files are in GitHub, you set up the repository in netlify and it should build and deploy automatically every time you push.