The Night I Pushed and Got a 404
Now and then a client asks for a single page first, "just something like a business card," before the full site exists. GitHub Pages plus Antigravity is the setup I reach for.
The first time I tried it, code generation was almost embarrassingly quick. I pushed, feeling pleased with myself, and the browser showed nothing but a 404. I spent about half an hour hunting for the cause, and it turned out I had never enabled Pages in the repository settings.
So what I'd like to say up front is that this setup rarely trips people up at code generation. It trips them up at publishing. Below is the full path from an Antigravity-generated portfolio to a live GitHub Pages site, including the spots where I got stuck.
What Is GitHub Pages — Understanding Free Hosting
GitHub Pages is GitHub's static site hosting. HTML, CSS, and JavaScript files in a repository are served as a website.
A few features worth knowing first:
- Completely free: Public repositories are hosted at no cost (private-repo availability depends on your plan)
- Automatic deployment: Pushing to
mainupdates the site when you publish from a branch - Custom domains: Use the default
username.github.iosubdomain or connect your own domain - Built-in HTTPS: Certificates are provisioned automatically; with a custom domain, check that "Enforce HTTPS" is ticked in settings
- GitHub Actions support: Integrate build pipelines for more advanced workflows
At portfolio scale you are unlikely to feel the usage limits, though they exist, so it's worth a glance at the official limits before you upload oversized images.
Setting Up — Antigravity and GitHub Prerequisites
You need three things:
- Antigravity IDE: Download and install from the official site
- GitHub account: Create a free account at github.com
- Git: Run
git --versionin your terminal to verify it's installed (Antigravity will guide you if it's missing)
Once Antigravity is installed, set up the GitHub integration. Open Antigravity's terminal and run:
# Configure your Git identity
git config --global user.name "Your Name"
git config --global user.email "your-email@example.com"
# Create a new GitHub repository
gh repo create my-portfolio --public --clone
cd my-portfolioThe gh command needs a prior gh auth login; skip it and repository creation stops right there. After that, the repository is linked to your workspace. If you're new to Antigravity, check out our Getting Started with Antigravity IDE guide for a thorough introduction.
Generating Your Portfolio with Antigravity's Agent
Next, the request to the agent. Describe what you want in plain language and a full set of site files comes back.
Open the chat panel and enter a prompt like this:
Create a portfolio website with these requirements:
- Single-page responsive design (HTML + CSS + JavaScript)
- Sections: hero, about me, skills, project showcase (3 projects), contact form
- Color scheme: dark theme (#0a0a0a base, #3b82f6 accent)
- Animations: scroll-triggered fade-in effects
- Performance: vanilla JS only, no external libraries
- File structure ready for GitHub Pages deploymentThe agent lays out the file structure and writes the code. Shortly afterward you should see index.html, style.css, and script.js.
Before publishing, check it locally:
# Start a local server for preview
npx serve .
# → Open http://localhost:3000 in your browserUnderstanding the Generated Code
A typical portfolio structure generated by Antigravity looks like this:
my-portfolio/
index.html # Main HTML file
style.css # Stylesheet
script.js # JavaScript (animations, interactions)
assets/
images/ # Profile photo, project screenshots
favicon.ico # Favicon
README.md # Repository description
The core structure of index.html follows standard best practices:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Portfolio - Web Developer Skills & Projects">
<title>My Portfolio</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- Navigation -->
<nav class="navbar" id="navbar">
<a href="#hero" class="nav-logo">Portfolio</a>
<ul class="nav-links">
<li><a href="#about">About</a></li>
<li><a href="#skills">Skills</a></li>
<li><a href="#projects">Projects</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</nav>
<!-- Hero Section -->
<section id="hero" class="hero">
<h1>Hello, I'm <span class="accent">Your Name</span></h1>
<p>Web Developer / Designer</p>
</section>
<!-- More sections... -->
<script src="script.js"></script>
</body>
</html>One thing that caught me: when the site lives at a sub-path such as username.github.io/my-portfolio/, a reference like /style.css with a leading slash looks at the domain root and misses. If CSS or images don't load, check first that your paths are relative.
And add a one-sentence meta description while you're here.
Customizing the Design — Iterating with AI
Adjusting the design happens through follow-up prompts in the chat panel. A few I use often:
# Change fonts
Apply Google Fonts "Inter" for headings and "Noto Sans JP" for body text
# Add gradient background
Add a purple-to-blue gradient background to the hero section,
going from bottom-left to top-right
# Redesign skills section
Convert the skills section to a card grid layout with icons.
Add a subtle lift effect on hoverEvery change shows up in Diff View, so you can see what moved. If it isn't what you meant, ⌘Z and rephrase.
Early on I asked for fonts, colors, and layout in one breath, and the result was a mess I couldn't untangle: I had no idea which instruction caused which breakage. These days I keep to one change per request.
Crafting the Projects Section — Showcasing Your Work
What visitors actually read is the projects section, so I start with the card shape:
Redesign the project cards with these specs:
- Thumbnail image (16:9 aspect ratio)
- Project name and brief description
- Technology tags in badge format
- Buttons linking to GitHub repo and live demo
- Thumbnail zoom animation on hoverHere's an example of the hover animation CSS that Antigravity generates:
/* Project card hover effects */
.project-card {
border-radius: 12px;
overflow: hidden;
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.project-card:hover {
transform: translateY(-4px);
box-shadow: 0 12px 24px rgba(59, 130, 246, 0.15);
}
.project-card .thumbnail {
transition: transform 0.4s ease;
}
.project-card:hover .thumbnail {
transform: scale(1.05); /* Subtle zoom on thumbnail */
}In each description, add one line on the problem you were facing, not just what you built. I'd write that line yourself rather than hand it to the agent: you're the only one who knows how it actually went, and that's what readers are looking for.
Deploying to GitHub Pages — Three Steps to Go Live
If it looks right locally, publishing takes three steps:
# Step 1: Commit your changes
git add .
git commit -m "Initial portfolio site"
# Step 2: Push to GitHub
git push origin main
# Step 3: Enable GitHub Pages (first time only; skip it and you get a 404)
# Settings → Pages → Source → "Deploy from a branch", then pick mainIt can take a few minutes to appear. Open https://your-username.github.io/my-portfolio/ and confirm.
You can also read the URL from the terminal:
# Check deployment status
gh api repos/{owner}/{repo}/pages --jq '.html_url'
# Output: https://your-username.github.io/my-portfolio/Setting Up Automatic Deployment with GitHub Actions
Publishing from a branch is enough at first. When you want a build step, switch to GitHub Actions. Ask Antigravity for the workflow:
Create a GitHub Actions workflow file that automatically deploys
to GitHub Pages whenever I push to the main branch.Here's what the generated workflow looks like:
# .github/workflows/deploy.yml
name: Deploy to GitHub Pages
on:
push:
branches: [main]
permissions:
contents: read
pages: write
id-token: write
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
- uses: actions/configure-pages@v5
- uses: actions/upload-pages-artifact@v3
with:
path: '.' # Deploy from repository root
- id: deployment
uses: actions/deploy-pages@v4With this workflow, set Settings → Pages → Source to "GitHub Actions" first. If the source stays on branch publishing, the workflow can succeed while the site never changes. Once switched, every push to main deploys automatically. For more on Antigravity's GitHub integration, see our GitHub Integration Guide.
Adding a Custom Domain (Optional)
For your own domain instead of username.github.io:
# Create a CNAME file
echo "portfolio.example.com" > CNAME
git add CNAME
git commit -m "Add custom domain"
git push origin mainThen configure your DNS provider with the following records:
- A records:
185.199.108.153,185.199.109.153,185.199.110.153,185.199.111.153 - CNAME record (for subdomains):
your-username.github.io
DNS can take a while to propagate; allow up to 24 hours so you don't panic. Record values can change, so confirm the current ones in GitHub's documentation before you set them.
What to Do Next
Looking back, the order was: have the agent generate the whole site, check it locally, then publish while confirming each setting one by one. Generation is quick. The publishing settings and the path check are where a human eye is needed.
Let the AI generate; check before going live with your own eyes. I hold to that line hardest on the days I'm rushing.
For a first step, generate just index.html, enable Settings → Pages, and get as far as seeing your own URL open. Polishing the look can come after. If you're curious about more advanced workflows, the Antigravity Best Practices Collection is a good next read.