forked from alvo254/orbit
-
Notifications
You must be signed in to change notification settings - Fork 2
/
do_stuff.sh
41 lines (28 loc) · 940 Bytes
/
do_stuff.sh
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
33
34
35
36
37
38
39
40
41
#!/bin/bash
sudo apt update -y
sudo apt install git -y
# sudo apt install nginx -y
# sudo systemctl enabel nginx
# sudo systemctl start nginx
sudo apt install -y curl software-properties-common
# Add NodeSource repository for Node.js v22
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install -y nodejs
echo "starting github app cloning....."
git clone https://github.com/alvo254/orbit /root/orbit
echo "Waiting for 30 seconds to ensure the repository is fully cloned..."
sleep 90
# Check if the directory exists
if [ -d "/root/orbit/" ]; then
cd /root/orbit/frontend
# Install the dependencies
npm install
# Build the React app for production
npm run build
# Install a web server (e.g., serve) to serve the React app
sudo npm install -g serve
# Start the React app using 'serve'
nohup serve -s build -l 80 &
else
echo "Directory /root/orbit/frontend does not exist."
fi