From 1ceb3b29bab45691cf2325d6ce69b64130318049 Mon Sep 17 00:00:00 2001 From: Tyler Hall Date: Mon, 23 Oct 2023 14:19:18 +0000 Subject: [PATCH] fix(mu): add deploy script --- servers/mu/deploy.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 servers/mu/deploy.js diff --git a/servers/mu/deploy.js b/servers/mu/deploy.js new file mode 100644 index 000000000..c36a59630 --- /dev/null +++ b/servers/mu/deploy.js @@ -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'))