-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·32 lines (23 loc) · 776 Bytes
/
deploy.sh
File metadata and controls
executable file
·32 lines (23 loc) · 776 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
set -e
APP_DIST="dist"
DEPLOY_DIR="~/screen-sampler.evan-roth.com/app"
echo "Cleaning old build..."
rm -rf $APP_DIST
echo "Building project..."
npm run build
# Ensure .htaccess exists for SPA routing
HTACCESS_CONTENT='RewriteEngine On
RewriteBase /app/
# Serve existing files normally
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# Redirect all other requests to index.html
RewriteRule ^ index.html [L]'
echo "$HTACCESS_CONTENT" > $APP_DIST/.htaccess
echo ".htaccess created for SPA routing"
# Deploy to server
echo "Deploying to DreamHost..."
rsync -avz --delete $APP_DIST/ [email protected]:$DEPLOY_DIR/
echo "✅ Deployment complete! Visit: https://screen-sampler.evan-roth.com/app/"