-
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 (26 loc) · 789 Bytes
/
deploy.sh
File metadata and controls
executable file
·36 lines (26 loc) · 789 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
# Diariser deployment script
# Usage: ./deploy.sh "commit message"
set -e
REPO="git@github.com:markalexwatson/diariser.git"
BRANCH="main"
# Check for commit message
if [ -z "$1" ]; then
echo "Usage: ./deploy.sh \"commit message\""
exit 1
fi
# Set up remote if not exists
if ! git remote get-url origin &>/dev/null; then
echo "Adding remote origin..."
git remote add origin "$REPO"
fi
# Ensure we're on main branch
git branch -M "$BRANCH"
# Stage all changes
git add -A
# Commit (will fail gracefully if nothing to commit)
git commit -m "$1" || echo "Nothing new to commit"
# Push (force to overwrite - fine for solo project)
echo "Pushing to $REPO..."
git push -u origin "$BRANCH" --force
echo "Done! Check https://markalexwatson.github.io/diariser/"