-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·96 lines (84 loc) · 2.89 KB
/
Copy pathdeploy.sh
File metadata and controls
executable file
·96 lines (84 loc) · 2.89 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash
# ============================================================
# InvoiceForge — One-Click Deploy Script
# ============================================================
# Usage: cd ~/Desktop/InvoiceForge && bash deploy.sh
#
# What this does:
# 1. Initializes a git repository (if not already)
# 2. Commits all files
# 3. Creates a GitHub repo named "invoiceforge"
# 4. Pushes to GitHub
# 5. Enables GitHub Pages
#
# Prerequisites:
# - Git installed and configured
# - GitHub CLI (gh) installed: brew install gh
# - Logged into GitHub: gh auth login
# ============================================================
set -e
REPO_NAME="invoiceforge"
SITE_URL="https://${REPO_NAME}.github.io/${REPO_NAME}/"
echo "🚀 InvoiceForge Deployment"
echo "=========================="
echo ""
# Check for git
if ! command -v git &> /dev/null; then
echo "❌ Git is not installed. Install it from: https://git-scm.com"
exit 1
fi
# Check for gh CLI
if ! command -v gh &> /dev/null; then
echo "❌ GitHub CLI is not installed."
echo " Install: brew install gh"
echo " Then run: gh auth login"
exit 1
fi
# Check if logged in
if ! gh auth status &> /dev/null; then
echo "❌ Not logged into GitHub."
echo " Run: gh auth login"
exit 1
fi
# Initialize git if needed
if [ ! -d ".git" ]; then
echo "📁 Initializing git repository..."
git init
git checkout -b main
fi
# Create .gitignore
if [ ! -f ".gitignore" ]; then
echo "📝 Creating .gitignore..."
cat > .gitignore << 'GITIGNORE'
.DS_Store
.invoiceforge/
GITIGNORE
fi
# Stage and commit
echo "📦 Staging and committing files..."
git add -A
git commit -m "🚀 Initial deployment — Freelancer Toolkit with 8 tools, 7 blog posts, Chrome extension landing page" || echo " (nothing new to commit)"
# Check if remote exists
if ! git remote get-url origin &> /dev/null; then
echo "🔗 Creating GitHub repository..."
gh repo create "$REPO_NAME" --public --source=. --remote=origin --push --description "Free Freelancer Toolkit: Invoice Generator, Proposal Builder, Contract Creator, Time Tracker, and more. All client-side, no signup."
else
echo "🔗 Pushing to GitHub..."
git push -u origin main
fi
# Enable GitHub Pages
echo "🌐 Enabling GitHub Pages..."
gh api repos/{owner}/$REPO_NAME/pages -X POST -f build_type=legacy -f source.branch=main -f source.path=/ 2>/dev/null || \
gh api repos/{owner}/$REPO_NAME/pages -X PUT -f build_type=legacy -f source.branch=main -f source.path=/ 2>/dev/null || \
echo " ⚠️ Pages may need to be enabled manually in repo Settings → Pages"
echo ""
echo "✅ Deployment complete!"
echo ""
echo "📋 Next steps:"
echo " 1. Visit: $SITE_URL"
echo " 2. Verify all tools work"
echo " 3. Set up Google Search Console"
echo " 4. Submit sitemap: ${SITE_URL}sitemap.xml"
echo " 5. Share on social media!"
echo ""
echo "🎉 Your site is live at: $SITE_URL"