Skip to main content

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

1

Enable GitHub Pages

  1. Go to your repository on GitHub
  2. Navigate to Settings > Pages
  3. Under “Source”, select “GitHub Actions”
2

Configure Repository

Ensure the workflow file .github/workflows/static.yml is present in your repository (it should be by default).
3

Push to Main

Any push to the main branch will trigger automatic deployment:
git add .
git commit -m "Update site"
git push origin main
4

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)

  1. Add a CNAME file to the repository root:
    www.yourdomain.com
    
  2. 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
      
  3. Enable HTTPS in GitHub Pages settings

Static Hosting Platforms

The site works with all major static hosting providers:

Netlify

1

Connect Repository

  1. Sign up at netlify.com
  2. Click “New site from Git”
  3. Connect your GitHub repository
2

Configure Build Settings

Build command: Leave empty (no build needed) Publish directory: . (root directory)
3

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

1

Import Project

  1. Visit vercel.com
  2. Click “New Project”
  3. Import your Git repository
2

Configure

  • Framework Preset: Other
  • Build Command: (leave empty)
  • Output Directory: .
3

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.

Performance Optimization

The site is already highly optimized, but here are additional production enhancements:

Image Optimization

The site supports modern image formats:
<picture>
  <source srcset="image.avif" type="image/avif">
  <source srcset="image.webp" type="image/webp">
  <img src="image.jpg" alt="Fallback">
</picture>
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

Meta Tags

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

Performance Monitoring

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

Security Headers

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

1

Test Locally

  • ✅ All pages load correctly
  • ✅ Navigation works on desktop and mobile
  • ✅ Search functionality works
  • ✅ Images load progressively
  • ✅ Forms submit properly
2

Run Performance Audits

  • ✅ Lighthouse score > 95 in all categories
  • ✅ Core Web Vitals meet targets
  • ✅ Images are optimized
  • ✅ Assets are minified
3

SEO Verification

  • ✅ Meta tags present
  • ✅ Sitemap.xml created
  • ✅ Robots.txt configured
  • ✅ Structured data added
  • ✅ Social media cards working
4

Security Check

  • ✅ HTTPS enabled
  • ✅ Security headers configured
  • ✅ No sensitive data exposed
  • ✅ Dependencies up to date
5

Cross-Browser Testing

  • ✅ Chrome/Edge
  • ✅ Firefox
  • ✅ Safari
  • ✅ Mobile browsers

Continuous Deployment

For automated deployments:
  1. Main branch = production
  2. Development branch = staging
  3. Pull requests trigger preview deployments
  4. 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

Build docs developers (and LLMs) love