From cbeb89f25e2b0e4e7d2abe33d6902dff80b14729 Mon Sep 17 00:00:00 2001 From: Diner Date: Sun, 15 Sep 2024 16:28:28 +0100 Subject: [PATCH] Set up cron job to deploy every morning --- app/api/cron/deploy/route.ts | 8 ++++++++ vercel.json | 8 ++++++++ 2 files changed, 16 insertions(+) create mode 100644 app/api/cron/deploy/route.ts create mode 100644 vercel.json diff --git a/app/api/cron/deploy/route.ts b/app/api/cron/deploy/route.ts new file mode 100644 index 00000000..d0e7a341 --- /dev/null +++ b/app/api/cron/deploy/route.ts @@ -0,0 +1,8 @@ +export default async function handler() { + if (!process.env.DEPLOY_URL) { + throw new Error( + 'You must define MONDAY_DEPLOY_URL env variable for this cron.', + ) + } + return await fetch(process.env.DEPLOY_URL) +} diff --git a/vercel.json b/vercel.json new file mode 100644 index 00000000..7a9bf81f --- /dev/null +++ b/vercel.json @@ -0,0 +1,8 @@ +{ + "crons": [ + { + "path": "/api/cron/deploy", + "schedule": "0 6 * * *" + } + ] +}