From f37d1fdaab27d7a6162801c14586e8e6e3a1efef Mon Sep 17 00:00:00 2001 From: silentsilas Date: Sun, 22 Sep 2024 01:32:24 -0400 Subject: [PATCH] add deploy script --- .gitignore | 1 + scripts/deploy.sh | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 scripts/deploy.sh diff --git a/.gitignore b/.gitignore index f0ce80b..de1f7bd 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ vite.config.js.timestamp-* vite.config.ts.timestamp-* .vercel vectorstore +ecosystem.config.js diff --git a/scripts/deploy.sh b/scripts/deploy.sh new file mode 100644 index 0000000..8c4aed7 --- /dev/null +++ b/scripts/deploy.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# Pull the latest changes +git pull + +# Build the project +npm run build + +# Copy necessary files +cp package.json ./build/ +cp package-lock.json ./build/ + +# Create or update the .env file +# echo "ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY" >> ./build/.env +#echo "OPENAI_API_KEY=$OPENAI_API_KEY" >> ./build/.env + +# Navigate to build directory and install dependencies +cd build +npm install + +# Restart the application +pm2 restart ecosystem.config.js