Skip to content

Commit

Permalink
Set up cron job to deploy every morning
Browse files Browse the repository at this point in the history
  • Loading branch information
DinerIsmail committed Sep 15, 2024
1 parent 2b0c9a2 commit cbeb89f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/api/cron/deploy/route.ts
Original file line number Diff line number Diff line change
@@ -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)
}
8 changes: 8 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"crons": [
{
"path": "/api/cron/deploy",
"schedule": "0 6 * * *"
}
]
}

0 comments on commit cbeb89f

Please sign in to comment.