-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
507e4ab
commit 1ceb3b2
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { z } from 'zod' | ||
|
||
function env (key) { | ||
const res = z.string().min(1).safeParse(process.env[key]) | ||
if (!res.success) { | ||
console.error(`Error with ENV VAR: ${key}`) | ||
throw res.error | ||
} | ||
return res.data | ||
} | ||
|
||
const deploy = async (deployHook) => { | ||
const response = await fetch(deployHook, { method: 'POST' }) | ||
.then((res) => res.json()) | ||
.catch((err) => err) | ||
console.log('Deploying To Render. Response:', response) | ||
} | ||
|
||
deploy(env('DEPLOY_HOOK')) |