Overview
As a static website with no build process, the Klef Sonatta website can be deployed to virtually any static hosting platform. This guide covers deployment options, optimization strategies, and best practices.
GitHub Pages Deployment
The project includes automated GitHub Pages deployment configured in .github/workflows/static.yml.
Automatic Deployment
The site automatically deploys to GitHub Pages on every push to the main branch:
on :
push :
branches : [ "main" ]
workflow_dispatch :
Setup Steps
Enable GitHub Pages
Go to your repository on GitHub
Navigate to Settings > Pages
Under “Source”, select “GitHub Actions”
Configure Repository
Ensure the workflow file .github/workflows/static.yml is present in your repository (it should be by default).
Push to Main
Any push to the main branch will trigger automatic deployment: git add .
git commit -m "Update site"
git push origin main
Access Your Site
Your site will be available at: https://[your-username].github.io/klef-sonatta-website/
Workflow Configuration
The deployment workflow:
jobs :
deploy :
environment :
name : github-pages
url : ${{ steps.deployment.outputs.page_url }}
runs-on : ubuntu-latest
steps :
- name : Checkout
uses : actions/checkout@v4
- name : Setup Pages
uses : actions/configure-pages@v5
- name : Upload artifact
uses : actions/upload-pages-artifact@v3
with :
path : '.'
- name : Deploy to GitHub Pages
id : deployment
uses : actions/deploy-pages@v4
The workflow uploads the entire repository as is - no build step needed!
Custom Domain (Optional)
Add a CNAME file to the repository root:
Configure DNS records:
CNAME Record : Point www to [username].github.io
A Records : Point apex domain to GitHub’s IPs:
185.199.108.153
185.199.109.153
185.199.110.153
185.199.111.153
Enable HTTPS in GitHub Pages settings
The site works with all major static hosting providers:
Netlify
Connect Repository
Sign up at netlify.com
Click “New site from Git”
Connect your GitHub repository
Configure Build Settings
Build command : Leave empty (no build needed)
Publish directory : . (root directory)
Deploy
Click “Deploy site” - done!
Netlify configuration (netlify.toml):
[ build ]
publish = "."
command = "echo 'No build required'"
[[ headers ]]
for = "/*"
[ headers . values ]
X-Frame-Options = "DENY"
X-XSS-Protection = "1; mode=block"
X-Content-Type-Options = "nosniff"
Referrer-Policy = "strict-origin-when-cross-origin"
[[ headers ]]
for = "/assets/*"
[ headers . values ]
Cache-Control = "public, max-age=31536000, immutable"
Vercel
Import Project
Visit vercel.com
Click “New Project”
Import your Git repository
Configure
Framework Preset : Other
Build Command : (leave empty)
Output Directory : .
Deploy
Click “Deploy” and your site goes live
Cloudflare Pages
# Install Wrangler CLI
npm install -g wrangler
# Login to Cloudflare
wrangler login
# Deploy
wrangler pages publish . --project-name=klef-sonatta
Or use the Cloudflare dashboard to connect your Git repository.
AWS S3 + CloudFront
For AWS deployment:
# Sync to S3 bucket
aws s3 sync . s3://your-bucket-name \
--exclude ".git/*" \
--exclude ".github/*" \
--exclude "docs/*" \
--cache-control "public, max-age=31536000" \
--exclude "index.html"
# Upload HTML with different cache settings
aws s3 sync . s3://your-bucket-name \
--exclude "*" \
--include "*.html" \
--cache-control "public, max-age=3600"
Then configure CloudFront for CDN distribution.
The site is already highly optimized, but here are additional production enhancements:
Image Optimization
Portfolio images use IntersectionObserver for lazy loading:
Images load 100px before entering viewport
Skeleton screens provide visual feedback
Reduces initial page weight significantly
Optimize images before deployment: # Using ImageMagick
mogrify -quality 85 -sampling-factor 4:2:0 -strip assets/images/ * .jpg
# Using cwebp for WebP
cwebp -q 80 input.jpg -o output.webp
CSS Optimization
/* Critical CSS is inlined */
/* Non-critical CSS loaded asynchronously */
< link rel="preload" href="assets/styles/ design-system .css" as="style" >
< link rel="stylesheet" href="assets/styles/ design-system .css" media="print" onload="this.media='all'" >
JavaScript Optimization
The site uses:
Vanilla JavaScript (ES6+) : No framework overhead
Module loading : Scripts load async/defer
Minimal dependencies : Only native APIs (IntersectionObserver, Fetch)
< script src = "assets/scripts/mega-menu-spa.js" defer ></ script >
Resource Hints
Add these to <head> for better performance:
<!-- DNS Prefetch for external resources -->
< link rel = "dns-prefetch" href = "//fonts.googleapis.com" >
<!-- Preconnect to critical origins -->
< link rel = "preconnect" href = "https://fonts.gstatic.com" crossorigin >
<!-- Preload critical assets -->
< link rel = "preload" href = "assets/fonts/inter.woff2" as = "font" type = "font/woff2" crossorigin >
< link rel = "preload" href = "assets/styles/design-system.css" as = "style" >
SEO Optimization
Ensure proper meta tags are present:
<!-- Primary Meta Tags -->
< title > Klef Agency - Branding, Strategy & Development </ title >
< meta name = "title" content = "Klef Agency - Branding, Strategy & Development" >
< meta name = "description" content = "Award-winning agency specializing in branding, digital strategy, and web development in Cabo San Lucas, Mexico." >
<!-- Open Graph / Facebook -->
< meta property = "og:type" content = "website" >
< meta property = "og:url" content = "https://klef.agency/" >
< meta property = "og:title" content = "Klef Agency" >
< meta property = "og:description" content = "Award-winning agency specializing in branding, digital strategy, and web development." >
< meta property = "og:image" content = "https://klef.agency/assets/images/og-image.jpg" >
<!-- Twitter -->
< meta property = "twitter:card" content = "summary_large_image" >
< meta property = "twitter:url" content = "https://klef.agency/" >
< meta property = "twitter:title" content = "Klef Agency" >
< meta property = "twitter:description" content = "Award-winning agency specializing in branding, digital strategy, and web development." >
< meta property = "twitter:image" content = "https://klef.agency/assets/images/twitter-image.jpg" >
Structured Data (Schema.org)
Add JSON-LD for better search results:
< script type = "application/ld+json" >
{
"@context": "https://schema.org",
"@type": "Organization",
"name": "Klef Agency",
"url": "https://klef.agency",
"logo": "https://klef.agency/assets/images/logo.png",
"description": "Award-winning agency specializing in branding, digital strategy, and web development",
"address": {
"@type": "PostalAddress",
"addressLocality": "Cabo San Lucas",
"addressCountry": "MX"
},
"contactPoint": {
"@type": "ContactPoint",
"email": "[email protected] ",
"contactType": "Customer Service"
}
}
</ script >
Sitemap
Create sitemap.xml in the root:
<? xml version = "1.0" encoding = "UTF-8" ?>
< urlset xmlns = "http://www.sitemaps.org/schemas/sitemap/0.9" >
< url >
< loc > https://klef.agency/ </ loc >
< lastmod > 2026-03-04 </ lastmod >
< priority > 1.0 </ priority >
</ url >
< url >
< loc > https://klef.agency/portfolio/casa-valentina-los-cabos-restaurant-brand/ </ loc >
< lastmod > 2026-03-04 </ lastmod >
< priority > 0.8 </ priority >
</ url >
<!-- Add more portfolio items -->
</ urlset >
Robots.txt
Create robots.txt in the root:
User-agent: *
Allow: /
Sitemap: https://klef.agency/sitemap.xml
Lighthouse Scores
Target metrics:
Performance : 95+
Accessibility : 95+
Best Practices : 95+
SEO : 95+
# Run Lighthouse audit
lighthouse https://your-site.com --view
Core Web Vitals
Optimize for:
LCP Largest Contentful Paint
Target: < 2.5sOptimizations:
Preload hero images
Optimize image sizes
Use CDN
FID First Input Delay
Target: < 100msOptimizations:
Minimal JavaScript
Defer non-critical JS
Use passive event listeners
CLS Cumulative Layout Shift
Target: < 0.1Optimizations:
Reserve image space
Use skeleton screens
Avoid dynamic content injection
Configure security headers in your hosting platform:
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Referrer-Policy: strict-origin-when-cross-origin
Permissions-Policy: geolocation=(), microphone=(), camera=()
Pre-Deployment Checklist
Test Locally
✅ All pages load correctly
✅ Navigation works on desktop and mobile
✅ Search functionality works
✅ Images load progressively
✅ Forms submit properly
Run Performance Audits
✅ Lighthouse score > 95 in all categories
✅ Core Web Vitals meet targets
✅ Images are optimized
✅ Assets are minified
SEO Verification
✅ Meta tags present
✅ Sitemap.xml created
✅ Robots.txt configured
✅ Structured data added
✅ Social media cards working
Security Check
✅ HTTPS enabled
✅ Security headers configured
✅ No sensitive data exposed
✅ Dependencies up to date
Cross-Browser Testing
✅ Chrome/Edge
✅ Firefox
✅ Safari
✅ Mobile browsers
Continuous Deployment
For automated deployments:
Main branch = production
Development branch = staging
Pull requests trigger preview deployments
Merging to main triggers production deployment
# Development workflow
git checkout -b feature/new-portfolio-item
# Make changes
git commit -m "Add new portfolio item"
git push origin feature/new-portfolio-item
# Create PR → Preview deployment generated
# After review → Merge to main → Production deployment
Rollback Strategy
If you need to rollback a deployment:
GitHub Pages
# Revert to previous commit
git revert HEAD
git push origin main
Netlify/Vercel
Use the dashboard to rollback to previous deployment with one click.
Monitoring & Analytics
Google Analytics
Add to <head>:
<!-- Google tag (gtag.js) -->
< script async src = "https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX" ></ script >
< script >
window . dataLayer = window . dataLayer || [];
function gtag (){ dataLayer . push ( arguments );}
gtag ( 'js' , new Date ());
gtag ( 'config' , 'G-XXXXXXXXXX' );
</ script >
Custom Event Tracking
The site dispatches custom events for tracking:
// Portfolio image loaded event
document . addEventListener ( 'image-loaded' , ( e ) => {
console . log ( 'Image loaded:' , e . detail . index );
// Send to analytics
gtag ( 'event' , 'image_loaded' , {
'image_index' : e . detail . index
});
});
Next Steps
Local Setup Learn how to set up local development
Components Explore the component architecture