-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·36 lines (29 loc) · 937 Bytes
/
deploy.sh
File metadata and controls
executable file
·36 lines (29 loc) · 937 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
33
34
35
36
#!/bin/bash
# before running this run a gitcredenv.sh
# which has
# export GIT_USERNAME="YOUR USERNAME"
# export GIT_EMAIL="YOUR EMAIL"
# export GIT_PASSWORD="YOU PERSONEL ACCESS TOKEN"
# and run
# source gitcredenv.sh
# then run ./deploy.sh
# Read Git credentials from environment variables
GIT_USERNAME="$GIT_USERNAME"
GIT_PASSWORD="$GIT_PASSWORD"
GIT_EMAIL="$GIT_EMAIL"
# Build the server
cd server
npm run build
# Go back to the root directory
cd ..
# Configure Git with your credentials
git config --global credential.helper "store --file ~/.git-credentials"
git config --global user.name "$GIT_USERNAME"
git config --global user.email "$GIT_EMAIL" # Use your email associated with Git
# Store the Git credentials
echo "https://$GIT_USERNAME:$GIT_PASSWORD@github.com" > ~/.git-credentials
TIMESTAMP=$(date +"%I:%M%p %B %d")
# Commit and push to GitHub
git add .
git commit -m "Deploy project $TIMESTAMP"
git push origin main