Question

Rebuild static website on content change

I have a Strapi CMS and Gridsome static website as 2 components on App platform. Is there a way to rebuild the static website on change using Strapi’s webhooks?

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

Hi there @stfnnklc,

It looks like that a similar question has been discussed previously here. What you could do is use the DigitalOcean API to force a rebuild for your application.

You would need to make a POST request to the /v2/apps/<app_id>/deployments route and pass a JSON document for the body. You can set the force_build option in it like so:

curl \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer TOKEN" \
    "https://api.digitalocean.com/v2/apps/<app_id>/deployments" \
    -XPOST \
    -d '{"force_build": true}'

Hope that this helps! Regards, Bobby

With the new DO serverless functions you could receive the Strapi webhook request and then trigger the deployment.