#Looking for a Directus flow to deploy an SSG website
8 messages · Page 1 of 1 (latest)
1 trigger per flow so if you want 15 mins OR on save, that’s two flows
Well well well, seems like I didn not expect this to be in the docs! checking this out, thanks a lot @sinful rune
🫡
We loosely followed the same process as is in that document when building our test site, but we didn't want the build to be triggered every time a site content item is created or updated since many items could be updated in quick succession or in bulk simultaneously. So here's we've done:
- We have a collection called KeyValue. This is a collection with just 2 fields Key (which is a string field that must be unique and is the primary key) and Value.
- We created an item in the KeyValue collection called
doBuild. - We created a flow that sets
doBuildtotruewhenever a site content item is created or updated (and status ispublished). - We then created another flow, which is scheduled to run every hour. This flow checks the value of
doBuild. If it is true, then it does the webhook operation that triggers the static site build and setsdoBuildback to false. IfdoBuildis false, it does nothing.
Interested to hear if there are different ways to achieve this (I'm completely new to Netlify and SSG, so wouldn't be surprised if we could simply limit the frequency the build could be run on Netlify's side), or if anyones done anything similar?
Ooh interesting