Currently, drafted records in DatoCMS appear in both Gatsby Cloud deploy builds and previews.
To reproduce:
set up a Dato CMS starter site in Gatsby Cloud
In the DatoCMS admin, go to Settings > Models > Work > Settings > Additional settings > Enable draft/published system
Create a New Record > Save
The new record should be saved as a draft
Trigger a new build
Actual: The drafted record appears as a page in the deploy build and the preview build.
Expected: The drafted record only appears in the preview build.
This change checks that this is both a Gatsby Cloud build, and that this is specifically a Preview build (the executing command is gatsby develop.
Currently, drafted records in DatoCMS appear in both Gatsby Cloud deploy builds and previews.
To reproduce:
Actual: The drafted record appears as a page in the deploy build and the preview build. Expected: The drafted record only appears in the preview build.
This change checks that this is both a Gatsby Cloud build, and that this is specifically a Preview build (the executing command is
gatsby develop
.