Github commit overwrite Netlify /static folder

Viewed 22

I'm running a website that is dependent of some data which changes daily. Each day at a specific time, I have a webhokk to Netlify which is triggering a build that is grabbing the data and saves it to /static/data folder of Gridsome. After the update is completed, the script that collects data is also saving a json file with the date when the last update of data occured.

My problem is that I've committed this data to github and every time I do a commit to github Netlify will copy a previous data from /static/data folder to LIVE exposing older data to my calls by overwriting the existing data which in most of the cases is older!

How do I tackle this issue? Will it be safe to add the /static/data folder to .gitignore? The decision to write new data is by comparing today date with the one I read from mysite.org/data/udapte.json

Any help will be appreciated.

Thanks!

0 Answers
Related