Skip to content

Commit 5362df1

Browse files
committed
Add GitHub push automation scripts
1 parent 116bc99 commit 5362df1

File tree

2 files changed

+125
-0
lines changed

2 files changed

+125
-0
lines changed

push-to-github.ps1

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# GitHub Push Script for AI_Coder_AllInOne (Windows PowerShell)
2+
3+
Write-Host "🚀 AI Coder All-in-One - GitHub Push Script" -ForegroundColor Cyan
4+
Write-Host "============================================" -ForegroundColor Cyan
5+
Write-Host ""
6+
7+
# Check if git is initialized
8+
if (-not (Test-Path ".git")) {
9+
Write-Host "❌ Error: Not a git repository. Run 'git init' first." -ForegroundColor Red
10+
exit 1
11+
}
12+
13+
# Prompt for GitHub username
14+
$GITHUB_USERNAME = Read-Host "Enter your GitHub username"
15+
16+
if ([string]::IsNullOrWhiteSpace($GITHUB_USERNAME)) {
17+
Write-Host "❌ Error: GitHub username cannot be empty." -ForegroundColor Red
18+
exit 1
19+
}
20+
21+
Write-Host ""
22+
Write-Host "📝 Setting up remote repository..." -ForegroundColor Yellow
23+
24+
# Remove existing origin if it exists
25+
git remote remove origin 2>$null
26+
27+
# Add new origin
28+
git remote add origin "https://github.com/$GITHUB_USERNAME/AI_Coder_AllInOne.git"
29+
30+
Write-Host "✅ Remote added: https://github.com/$GITHUB_USERNAME/AI_Coder_AllInOne.git" -ForegroundColor Green
31+
Write-Host ""
32+
33+
# Rename branch to main
34+
Write-Host "📝 Renaming branch to 'main'..." -ForegroundColor Yellow
35+
git branch -M main
36+
37+
Write-Host ""
38+
Write-Host "🔄 Pushing to GitHub..." -ForegroundColor Yellow
39+
Write-Host ""
40+
41+
# Push to GitHub
42+
git push -u origin main
43+
44+
if ($LASTEXITCODE -eq 0) {
45+
Write-Host ""
46+
Write-Host "✅ Successfully pushed to GitHub!" -ForegroundColor Green
47+
Write-Host ""
48+
Write-Host "📦 Next steps:" -ForegroundColor Cyan
49+
Write-Host "1. Visit: https://github.com/$GITHUB_USERNAME/AI_Coder_AllInOne"
50+
Write-Host "2. Enable GitHub Actions (should be automatic)"
51+
Write-Host "3. Wait for Docker image to build"
52+
Write-Host "4. Update README.md badges with your username"
53+
Write-Host ""
54+
Write-Host "🐳 Once built, your image will be available at:" -ForegroundColor Cyan
55+
Write-Host " ghcr.io/$GITHUB_USERNAME/ai_coder_allinone:latest"
56+
} else {
57+
Write-Host ""
58+
Write-Host "❌ Push failed. Please check:" -ForegroundColor Red
59+
Write-Host "1. Repository exists: https://github.com/$GITHUB_USERNAME/AI_Coder_AllInOne"
60+
Write-Host "2. You have push permissions"
61+
Write-Host "3. Your GitHub credentials are correct"
62+
}

push-to-github.sh

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#!/bin/bash
2+
# GitHub Push Script for AI_Coder_AllInOne
3+
4+
echo "🚀 AI Coder All-in-One - GitHub Push Script"
5+
echo "============================================"
6+
echo ""
7+
8+
# Check if git is initialized
9+
if [ ! -d ".git" ]; then
10+
echo "❌ Error: Not a git repository. Run 'git init' first."
11+
exit 1
12+
fi
13+
14+
# Prompt for GitHub username
15+
read -p "Enter your GitHub username: " GITHUB_USERNAME
16+
17+
if [ -z "$GITHUB_USERNAME" ]; then
18+
echo "❌ Error: GitHub username cannot be empty."
19+
exit 1
20+
fi
21+
22+
echo ""
23+
echo "📝 Setting up remote repository..."
24+
25+
# Remove existing origin if it exists
26+
git remote remove origin 2>/dev/null
27+
28+
# Add new origin
29+
git remote add origin "https://github.com/${GITHUB_USERNAME}/AI_Coder_AllInOne.git"
30+
31+
echo "✅ Remote added: https://github.com/${GITHUB_USERNAME}/AI_Coder_AllInOne.git"
32+
echo ""
33+
34+
# Rename branch to main
35+
echo "📝 Renaming branch to 'main'..."
36+
git branch -M main
37+
38+
echo ""
39+
echo "🔄 Pushing to GitHub..."
40+
echo ""
41+
42+
# Push to GitHub
43+
git push -u origin main
44+
45+
if [ $? -eq 0 ]; then
46+
echo ""
47+
echo "✅ Successfully pushed to GitHub!"
48+
echo ""
49+
echo "📦 Next steps:"
50+
echo "1. Visit: https://github.com/${GITHUB_USERNAME}/AI_Coder_AllInOne"
51+
echo "2. Enable GitHub Actions (should be automatic)"
52+
echo "3. Wait for Docker image to build"
53+
echo "4. Update README.md badges with your username"
54+
echo ""
55+
echo "🐳 Once built, your image will be available at:"
56+
echo " ghcr.io/${GITHUB_USERNAME}/ai_coder_allinone:latest"
57+
else
58+
echo ""
59+
echo "❌ Push failed. Please check:"
60+
echo "1. Repository exists: https://github.com/${GITHUB_USERNAME}/AI_Coder_AllInOne"
61+
echo "2. You have push permissions"
62+
echo "3. Your GitHub credentials are correct"
63+
fi

0 commit comments

Comments
 (0)