Comprehensive deployment guide for BorderlessBits.com with enterprise-grade CI/CD pipeline and zero-cost hosting strategy.
# Clone repository
git clone https://github.com/yourusername/borderlessbits.com.git
cd borderlessbits.com
# Install dependencies
npm install
# Setup environment variables
cp .env.example .env.local
# Edit .env.local with your configuration
# Setup GitHub secrets
./scripts/setup-secrets.sh -t $GITHUB_TOKEN -r username/borderlessbits.com
# Initial deployment test
npm run build
npm run preview
G-XXXXXXXXXX
)Configure Privacy Settings:
gtag('config', 'G-XXXXXXXXXX', {
anonymize_ip: true,
allow_ad_personalization_signals: false,
allow_google_signals: false,
});
GA_MEASUREMENT_ID
Contact Form Template:
Subject: New Contact - From: <>
Company: Project: Timeline:
Budget: Message: --- Submitted:
Auto-Reply Template:
Subject: Thank you for contacting BorderlessBits Hi , Thank you for
your interest in our services. We'll respond within 24 hours.
Best regards, Richard Mosley BorderlessBits
EMAILJS_SERVICE_ID
EMAILJS_TEMPLATE_ID
EMAILJS_PUBLIC_KEY
Create Netlify Account: netlify.com
borderlessbits-prod
borderlessbits-staging
borderlessbits-preview
Configure Build Settings:
Build command: npm run build
Publish directory: out
Environment variables:
NODE_VERSION: 18
NEXT_PUBLIC_SITE_URL: https://borderlessbits.com
borderlessbits.com
staging.borderlessbits.com
backup.borderlessbits.com
NETLIFY_AUTH_TOKEN
NETLIFY_SITE_ID
NETLIFY_STAGING_SITE_ID
NETLIFY_PREVIEW_SITE_ID
borderlessbits.com
DNS Configuration:
# A Records (GitHub Pages IPs)
A borderlessbits.com 185.199.108.153
A borderlessbits.com 185.199.109.153
A borderlessbits.com 185.199.110.153
A borderlessbits.com 185.199.111.153
# CNAME for www
CNAME www.borderlessbits.com borderlessbits.com
Uptime Robot Setup:
# Automated setup
./scripts/monitoring/uptime-robot-setup.sh -k $UPTIME_ROBOT_API_KEY
https://borderlessbits.com
(5-min intervals)https://borderlessbits.com/contact
(5-min intervals)https://staging.borderlessbits.com
(15-min intervals)https://backup.borderlessbits.com
(15-min intervals)Domain: https://borderlessbits.com Hosting: GitHub Pages (primary),
Netlify (backup) Branch: main
Deployment: Automatic on push to main
Configuration:
NODE_ENV: production
NEXT_PUBLIC_SITE_URL: https://borderlessbits.com
NEXT_PUBLIC_GA_MEASUREMENT_ID: G-XXXXXXXXXX
Features:
Domain: https://staging.borderlessbits.com Hosting: Netlify Branch:
develop
Deployment: Automatic on push to develop
Configuration:
NODE_ENV: development
NEXT_PUBLIC_SITE_URL: https://staging.borderlessbits.com
NEXT_PUBLIC_GA_MEASUREMENT_ID: G-STAGING-ID
Features:
Domain: https://preview-pr-{number}.netlify.app Hosting: Netlify Branch: Any feature branch in PR Deployment: Automatic on PR creation/update
Features:
Script: scripts/deploy.sh
# Deploy to production (all targets)
./scripts/deploy.sh
# Deploy to staging
./scripts/deploy.sh -e staging
# Deploy to specific target
./scripts/deploy.sh -t netlify
# Dry run (preview changes)
./scripts/deploy.sh -d
# Force deployment (skip validations)
./scripts/deploy.sh -f
# Skip tests
./scripts/deploy.sh -s
Production Deployment:
# Automatic trigger
git push origin main
# Manual trigger
gh workflow run deploy-production.yml
Staging Deployment:
# Automatic trigger
git push origin develop
# Auto-promote to production
git commit -m "Update feature [auto-promote]"
git push origin develop
Preview Deployment:
# Automatic on PR creation
git checkout -b feature/new-feature
git push origin feature/new-feature
# Create PR on GitHub
# Development server
npm run dev
# Production build locally
npm run build
npm run preview
# Docker development
docker-compose up
# Docker production preview
docker-compose --profile production up
Triggers:
Process:
Script: scripts/rollback.sh
# Rollback to latest backup
./scripts/rollback.sh
# List available backups
./scripts/rollback.sh -l
# Rollback to specific backup
./scripts/rollback.sh -b backup-20231201-143022
# Emergency rollback (skip confirmations)
./scripts/rollback.sh -y
# Rollback specific target
./scripts/rollback.sh -t netlify
Backup Management:
Setup Script: scripts/setup-secrets.sh
# Interactive setup
./scripts/setup-secrets.sh -t $GITHUB_TOKEN -r username/repo
# List existing secrets
./scripts/setup-secrets.sh -t $GITHUB_TOKEN -r username/repo -l
# Batch setup (CI mode)
export GOOGLE_ANALYTICS_ID="G-XXXXXXXXXX"
export EMAILJS_SERVICE_ID="service_xxxxx"
# ... other environment variables
./scripts/setup-secrets.sh -t $GITHUB_TOKEN -r username/repo
Required Secrets: | Secret | Purpose | Example | |||
——– | ——— | ——— | GA_MEASUREMENT_ID |
Google Analytics tracking | ||
G-XXXXXXXXXX |
EMAILJS_SERVICE_ID |
Email service configuration | ||||
service_xxxxxxx |
EMAILJS_TEMPLATE_ID |
Email template ID | ||||
template_xxxxxxx |
EMAILJS_PUBLIC_KEY |
EmailJS public key | xxxxxxxxxx |
|||
NETLIFY_AUTH_TOKEN |
Netlify deployment | nfp_xxxxxxxxxx |
||||
NETLIFY_SITE_ID |
Production site ID | xxxxxxxx-xxxx-xxxx |
Automated Scans:
Manual Security Checks:
# Run security audit
npm audit --audit-level moderate
# Container security scan
docker build -t borderlessbits:security .
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock \
aquasec/trivy image borderlessbits:security
# Security headers validation
curl -I https://borderlessbits.com | grep -E "(X-Frame-Options|X-XSS-Protection|Content-Security-Policy)"
# Bundle analysis
npm run analyze
# Performance audit
npm run lighthouse
# Test different device profiles
npm run lighthouse:mobile
npm run lighthouse:desktop
Thresholds:
Images:
JavaScript:
CSS:
Automated Checks:
Monitoring Endpoints:
# Production health check
curl -f https://borderlessbits.com/
# Contact form availability
curl -f https://borderlessbits.com/contact
# Staging environment
curl -f https://staging.borderlessbits.com/
# Backup site
curl -f https://backup.borderlessbits.com/
Core Web Vitals Tracking:
// Real User Monitoring
import { getCLS, getFID, getFCP, getLCP } from 'web-vitals';
getCLS(console.log);
getFID(console.log);
getFCP(console.log);
getLCP(console.log);
Lighthouse CI Integration:
# Continuous performance monitoring
lhci autorun --config=lighthouserc.json
# Performance budgets enforcement
npm run lighthouse:ci
Alert Levels:
Notification Channels:
Build Failures:
# Check Node.js version
node --version # Should be 18+
# Clear cache and reinstall
npm run clean
rm -rf node_modules package-lock.json
npm install
# Check for TypeScript errors
npm run type-check
# Validate environment variables
npm run validate
Deployment Failures:
# Check GitHub Actions logs
gh run list --workflow=deploy-production.yml
# Verify secrets configuration
gh secret list
# Test local build
npm run build
ls -la out/ # Verify output directory
# Check third-party services
curl -f https://api.netlify.com/api/v1/sites \
-H "Authorization: Bearer $NETLIFY_AUTH_TOKEN"
Performance Issues:
# Analyze bundle sizes
npm run analyze
# Run Lighthouse audit
npm run lighthouse
# Check image optimization
npm run optimize-images
# Validate Core Web Vitals
npm run test:performance
Form Issues:
# Test EmailJS configuration
curl -X POST https://api.emailjs.com/api/v1.0/email/send \
-H "Content-Type: application/json" \
-d '{"service_id":"YOUR_SERVICE_ID","template_id":"YOUR_TEMPLATE_ID","user_id":"YOUR_PUBLIC_KEY"}'
# Check Netlify forms (if using)
curl -X POST https://your-site.netlify.app/ \
-F "form-name=contact" \
-F "name=Test" \
-F "email=test@example.com"
Critical Production Issue:
Immediate Response:
# Execute emergency rollback
./scripts/rollback.sh -y -e production
Security Incident:
Immediate Actions:
# Rotate all secrets
./scripts/setup-secrets.sh --rotate-all
# Review access logs
gh api repos/:owner/:repo/actions/runs \
--jq '.workflow_runs[] | select(.created_at > "2023-12-01")'
100GB/month Bandwidth Exceeded:
Form Submissions >100/month:
Build Minutes >2000/month:
Stage 1: Enhanced Features ($20-40/month)
Stage 2: Custom Infrastructure ($100-500/month)
Stage 3: Enterprise Solutions ($500+/month)
Documentation: GitHub Repository Issues: Create GitHub issue with detailed description Email: richard@borderlessbits.com Response Time: Within 24 hours for deployment issues
Emergency Support: Available for critical production issues affecting business operations