Created
March 2, 2023 14:05
-
-
Save philhawksworth/d5b4f7ea48541a20d183eba53b1400a7 to your computer and use it in GitHub Desktop.
Revisions
-
Phil Hawksworth created this gist
Mar 2, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ // npm install @netlify/functions // to get access to scheduling function invocations // using cron notiation or some handy aliases const { schedule } = require("@netlify/functions"); const handler = async function(event, context) { // Trigger a site rebuild and deploy fetch("https://api.netlify.com/build_hooks/HOOK-ID-FROM-ADMIN", { method: "POST" }); return { statusCode: 200, }; }; exports.handler = schedule("@daily", handler);