← Back to Documentation

Deploy to GitHub Pages

Host your launchpage directly from your GitHub repository with GitHub Pages. It's completely free, includes SSL, and integrates seamlessly with your Git workflow.

Why GitHub Pages?

Prerequisites

Step 1: Push Your Code to GitHub

If you haven't already, push your launchpage to a GitHub repository:

# Initialize git (if not already done)
git init

# Add your files
git add .

# Commit
git commit -m "Initial commit"

# Add GitHub remote
git remote add origin https://github.com/yourusername/launchpage.xyz.git

# Push to GitHub
git push -u origin main

Step 2: Enable GitHub Pages

  1. Go to your repository on GitHub
  2. Click "Settings" (in the repository menu)
  3. Scroll down to "Pages" in the left sidebar
  4. Under "Source", configure:
    • Branch: Select main (or your branch name)
    • Folder: Select / (root)
  5. Click "Save"

GitHub will build and deploy your site. Within a few minutes, it will be live at:

https://yourusername.github.io/launchpage.xyz
Note: If your repository is named yourusername.github.io, the site will be available at https://yourusername.github.io (without the repo name in the URL).

Step 3: Add Your Custom Domain

Now let's connect your custom domain to GitHub Pages:

In GitHub Settings

  1. In "Settings""Pages", find "Custom domain"
  2. Enter your domain (e.g., example.com)
  3. Click "Save"
  4. This will create a CNAME file in your repository

Configure DNS

At your domain registrar, configure DNS records:

For Root Domain (example.com)

Add four A records pointing to GitHub's IP addresses:

Type: A
Name: @
Value: 185.199.108.153

Type: A
Name: @
Value: 185.199.109.153

Type: A
Name: @
Value: 185.199.110.153

Type: A
Name: @
Value: 185.199.111.153

For www Subdomain (www.example.com)

Add a CNAME record:

Type: CNAME
Name: www
Value: yourusername.github.io
Important: Replace yourusername with your actual GitHub username.

Step 4: Enable HTTPS

Once DNS is configured and propagated:

  1. Go back to "Settings""Pages"
  2. Wait for the DNS check to complete (can take up to 24 hours, usually much faster)
  3. Once verified, check "Enforce HTTPS"

GitHub will automatically provision a free SSL certificate from Let's Encrypt!

Alternative: Using CNAME File

You can also create the CNAME file manually in your repository:

# Create CNAME file in your repository root
echo "example.com" > CNAME

# Commit and push
git add CNAME
git commit -m "Add custom domain"
git push

Automatic Deployments

GitHub Pages automatically rebuilds and deploys when you push to your configured branch:

# Make changes to your launchpage
# ... edit files ...

# Commit and push
git add .
git commit -m "Update launchpage"
git push

# GitHub Pages will automatically redeploy!

Check Deployment Status

Multiple Domains (Limitation)

GitHub Pages has a limitation: you can only configure one custom domain per repository.

Workaround for Multiple Domains

If you need multiple domains pointing to the same launchpage:

  1. Option A: Use domain forwarding at your registrar
    • Set up one domain on GitHub Pages (e.g., primary-domain.com)
    • Configure other domains to redirect to the primary domain
  2. Option B: Use Cloudflare or another DNS provider
    • Configure Cloudflare to proxy multiple domains to your GitHub Pages site
    • Set up page rules for domain handling
  3. Option C: Deploy to multiple platforms
    • Use Netlify or Vercel for additional domains (they support multiple domains)
    • All platforms can serve the same repository

Custom 404 Page (Optional)

Create a custom 404 page by adding 404.html to your repository root:

<!DOCTYPE html>
<html>
<head>
    <title>Page Not Found</title>
</head>
<body>
    <h1>404 - Page Not Found</h1>
    <p><a href="/">Go to homepage</a></p>
</body>
</html>

Collect Emails/Waitlist

To collect email submissions from your launchpage, you'll need to set up a Cloudflare Worker. This allows you to store and access visitor submissions.

Follow our complete guide: Collect Emails/Waitlist →

After setting up the Worker, update the form action in your index.html before deploying to GitHub Pages:

<form class="email-form" id="emailForm" method="POST"
      action="https://YOUR-WORKER-URL.workers.dev">

Troubleshooting

Site not loading?

Custom domain not working?

HTTPS not available?

Changes not appearing?

GitHub Pages Limitations

Be aware of these GitHub Pages constraints:

For most launchpage use cases, these limits are more than sufficient!

Other Deployment Platforms


Need help? Open an issue on GitHub or check the GitHub Pages documentation.

← Back to Documentation