#Static export automatically done every X hours?

3 messages · Page 1 of 1 (latest)

blissful fossil
#

Hi there, Im creating a website similar to a blog, and I'm using the static export https://nextjs.org/docs/advanced-features/static-html-export because I'd like to host my website without using a node server in production, like Cloudflare Pages, Netlify, Github Pages, etc. But the issue is that my content updates every 12 hours, so would I have to manually run the next static export command every 12 hours and upload the build manually? I thought about making the website in plain React with no Next but I'd like to have the benefits of static site generation (SSG) for SEO.

Something I could do is set up a VPS where it automatically runs "next static export" every 12 hours and then it uploads the build files to a static host like Cloudflare Pages/Netlify/Github Pages. With this method I achieve the goal of not using a node server in production, but seems a bit uncomfortable, is there an easier solution that I'm not aware of?

Export your Next.js app to static HTML, and run it standalone without the need of a Node.js server.

dusk steppe
#

@blissful fossil where did you on this decision? I am following the same concept, but deploying to AWS S3.

blissful fossil
# dusk steppe <@714565128296726680> where did you on this decision? I am following the same c...

I ended up using github actions to trigger a deploy and upload the build files, here's more info about it: https://www.freecodecamp.org/news/how-to-use-github-actions-to-deploy-a-next-js-website-to-aws-s3/

freeCodeCamp.org

The beauty of Next.js and static web apps is that they let you run the project pretty much anywhere using object storage, like on AWS S3. But it can be a pain to manually update those files each time. How can we use GitHub Actions to automate and continuously