josue-rojas/Gatsby-Notebook

clear cache for deploy

Opened this issue · 1 comments

I notice that clearing the cache makes the md that is set to unpublished that were publish show the correct 404 page instead of crashing or showing the page. I will assume with limited knowledge and research I have done, that Gatsby should clear the cache after the rebuild, but to make sure this is true, it will make sense to add gatsby clean and maybe also remove the build folder. This way we can have a fresh build before deploy.

another approach is to use onCreate and delete the pages that have unpublished, this might solve the issue on development when unpublished might throw an error if it is toggled. for this I might need to also check if the page was unpublished to actually be able to delete the page (this can be solve badly with publishing all pages then checking).

why not both?
I think both will work to ensure a fresh build for deployment and solving the issue in deployment.

doesn't seem to be a problem so far with the few deployments I have made, will leave this open though.