Netlify is an all-in-one platform for automating modern web projects with a single workflow.
In this example, we are going to make use of Netlify Build Hooks to trigger a deployment automatically on a configured branch whenever there is an insert on a database table.
For example:
If a new row is inserted in the blog table, we trigger the netlify build hook to rebuild our site deployed on Netlify.
You can use the one-click to deploy on Hasura Cloud to get started quickly
You'll need the following environment variables.
NETLIFY_BUILD_HOOK: "https://api.netlify.com/build_hooks/XXXXXXXXXXXXXXX"
If you are using Docker you can provide these environment variables along with the rest of your Hasura configuration information.
Check out Netlify Docs on Creating and configuring a build hook
Importing actions and events into Hasura apply one or more actions. Actions based on request configurations and will need metadata to be applied. Events need underlying table structure to trigger the events.
Steps required for this integration:
To apply metadata into your project. You will need:
/hasura
.More information about Hasura CLI can be found in the documentation.
Once metadata is applied, you will apply the database migrations.
hasura migrate apply
For the migration changes to reflect, we will execute the metadata reload command.
hasura metadata reload
Working on an interesting idea using Hasura?
Submit a new integration