discourse/scripts/deploy-frontend.sh

34 lines
677 B
Bash
Raw Permalink Normal View History

2025-03-25 03:52:30 -04:00
#!/bin/bash
# Script to deploy the VoxPop frontend
# Exit on any error
set -e
# Set variables
ENV=${1:-development}
PROJECT_ROOT=$(dirname "$(dirname "$(realpath "$0")")")
FRONTEND_DIR="$PROJECT_ROOT/frontend"
echo "Deploying VoxPop frontend in $ENV environment..."
# Navigate to frontend directory
cd "$FRONTEND_DIR"
# Install dependencies
echo "Installing dependencies..."
npm install
# Build the application
echo "Building frontend application..."
npm run build
if [ "$ENV" = "production" ]; then
echo "Starting production server..."
npm run start
else
echo "Starting development server..."
npm run dev
fi
echo "Frontend deployment completed successfully!"