GitHub Pages Tutorial

Publishing AI-Generated HTML Files with Educator Benefits

Overview

This tutorial will guide you through the complete process of uploading AI-generated HTML files to GitHub and publishing them as live websites using GitHub Pages. You'll also learn how to unlock GitHub's educator benefits using your .edu email address.

Prerequisites:
  • A computer with internet access
  • AI-generated HTML files you want to publish
  • A .edu email address from an accredited educational institution
  • Basic computer skills (creating folders, uploading files)

Part 1: Getting GitHub Educator Benefits

1Create a GitHub Account

Navigate to GitHub.com

  • Go to github.com
  • Click the "Sign up" button in the top-right corner

Create Your Account

  • Enter your full name
  • Use your .edu email address (this is crucial for educator benefits)
  • Create a strong password
  • Choose a username (this will be part of your website URL)
  • Complete the verification process

Verify Your Email

  • Check your .edu email inbox
  • Click the verification link from GitHub
  • This step is essential for educator benefits

2Apply for GitHub Education Benefits

Access Education Benefits

  1. Log into your GitHub account
  2. Click your profile picture in the top-right corner
  3. Select "Settings" from the dropdown menu

Navigate to Education Benefits

  1. In the left sidebar, look for "Billing and licensing" (for newer accounts) or "Billing and plans" (for older accounts)
  2. Click on the billing section
  3. Look for "Education benefits" or "GitHub Education"

Start Your Application

  1. Click "Start an application" or "Apply for benefits"
  2. Select your role: "Teacher" or "Student" (choose based on your actual role)

Complete the Application

  • School Information: Enter your institution's name
  • Email Verification: Confirm your .edu email address
  • Documentation: Upload proof of academic affiliation such as:
    • Faculty ID
    • Employment verification letter
    • Student ID (if you're a student)
    • Official enrollment documentation

Submit and Wait

  1. Review all information carefully
  2. Click "Submit application"
  3. Processing time: Usually 2-5 business days
  4. You'll receive an email when approved
  5. Benefits activate within 72 hours of approval

What You'll Get with Educator Benefits

  • GitHub Pro account (normally $4/month) - FREE
  • GitHub Copilot Pro - AI coding assistant - FREE
  • GitHub Codespaces - Cloud development environment - FREE
  • GitHub Actions - Advanced CI/CD features - FREE
  • Access to GitHub Classroom for managing student assignments
  • Unlimited private repositories
  • Advanced collaboration tools

Part 2: Creating Your Repository

3Create a New Repository

Start a New Repository

  1. From your GitHub dashboard, click the green "New" button or the "+" icon
  2. Select "New repository"

Repository Settings

  • Repository name: Choose a descriptive name (e.g., "my-website", "portfolio", "ai-project")
    • For a personal website: use yourusername.github.io
    • For a project website: use any descriptive name
  • Description: Write a brief description of your project
  • Visibility: Select "Public" (required for free GitHub Pages)
  • Initialize repository: Check ☑️ "Add a README file"
  • Click "Create repository"
Important Naming Convention:
  • Personal site: yourusername.github.io → Will be available at https://yourusername.github.io
  • Project site: any-name → Will be available at https://yourusername.github.io/any-name

Part 3: Uploading Your HTML Files

4Prepare Your Files

Before uploading, ensure your HTML files are properly prepared:

  1. Main HTML file: Must be named index.html (this is your homepage)
  2. Standalone HTML files: Your AI-generated HTML files should contain embedded CSS and JavaScript within the same file
  3. File structure should look like:
your-project/
├── index.html (main page with embedded CSS/JS)
├── ai_project1.html (your first AI-generated project)
├── ai_project2.html (your second AI-generated project)
├── about.html (additional pages if needed)
├── contact.html (additional pages if needed)
└── images/ (optional - only if you have separate image files)
    ├── photo1.jpg
    └── photo2.png

File name requirements:

  • No spaces in file names (use hyphens or underscores)
  • Use lowercase letters when possible
  • Avoid special characters
  • Your main file MUST be named index.html
Note: Since you're working with standalone HTML files that include embedded CSS and JavaScript, you typically won't need separate folders for stylesheets or scripts. Everything should be contained within your HTML files.

5Upload Files via GitHub Web Interface

Access Your Repository

  1. Navigate to your repository on GitHub
  2. You should see the README.md file you created

Start Upload Process

  1. Click "Add file" button
  2. Select "Upload files" from the dropdown

Upload Your Files

  • Drag and drop your entire project folder into the browser window
  • OR click "choose your files" to browse and select files
  • GitHub will automatically maintain your folder structure

Commit Your Changes

  1. Scroll down to "Commit changes" section
  2. Commit message: Write a descriptive message like "Add initial website files"
  3. Description (optional): Add more details about what you're uploading
  4. Select "Commit directly to the main branch"
  5. Click "Commit changes"

6Creating and Editing Your index.html File

Creating index.html Directly on GitHub

If you don't have an index.html file yet, you can create it directly on GitHub:

  1. In your repository, click "Add file"
  2. Select "Create new file"
  3. Name the file index.html
  4. Add your HTML content in the editor (see example below)
  5. Scroll down and commit the file

Basic HTML Template with Embedded CSS and JavaScript

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>My AI-Generated Website</title>
    <style>
        /* Your CSS styles go here */
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 20px;
            background-color: #f4f4f4;
        }
        .container {
            max-width: 800px;
            margin: 0 auto;
            background: white;
            padding: 20px;
            border-radius: 8px;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>Welcome to My Website</h1>
        <p>This is my AI-generated website hosted on GitHub Pages!</p>
        <button onclick="showMessage()">Click Me!</button>
        <div id="message"></div>
    </div>

    <script>
        // Your JavaScript code goes here
        function showMessage() {
            document.getElementById('message').innerHTML = 
                '<p>Hello from embedded JavaScript!</p>';
        }
    </script>
</body>
</html>

Editing Existing HTML Files

To edit an existing HTML file on GitHub:

  1. Navigate to the file in your repository
  2. Click the pencil icon (✏️) to edit
  3. Make your changes in the editor
  4. Preview your changes using the "Preview" tab if available
  5. Scroll down to commit your changes
  6. Add a descriptive commit message like "Update homepage content"
  7. Click "Commit changes"
Pro Tip: After committing changes to your index.html file, your live website will automatically update within 5-10 minutes. You can refresh your GitHub Pages URL to see the changes.
Alternative: Upload Individual Files
If you prefer to upload files one by one or need to create folders:
  1. Create folders first (only if needed for images):
    • Click "Add file""Create new file"
    • Type images/placeholder.txt
    • Add some content and commit
    • Delete placeholder later
  2. Upload to specific folders:
    • Navigate into the folder
    • Click "Add file""Upload files"
    • Upload relevant files

Part 4: Publishing with GitHub Pages

7Enable GitHub Pages

Access Repository Settings

  1. In your repository, click the "Settings" tab (far right in the repository menu)

Navigate to Pages Section

  1. Scroll down the left sidebar
  2. Click "Pages" under the "Code and automation" section

Configure Publishing Source

  1. Under "Build and deployment"
  2. Source: Select "Deploy from a branch" from the dropdown
  3. Branch: Select "main" (or "master" if that's your default branch)
  4. Folder: Select "/ (root)" unless your files are in a specific folder
  5. Click "Save"

8Access Your Published Website

Wait for Deployment

  • GitHub Pages takes 5-10 minutes to build and deploy
  • You'll see a green checkmark when it's ready

Find Your Website URL

  1. Return to the "Pages" section in Settings
  2. You'll see: "Your site is live at https://username.github.io/repository-name"
  3. Click the link to view your website

Bookmark Your Site

  • Personal site (if repository named username.github.io): https://username.github.io
  • Project site: https://username.github.io/repository-name

Part 5: Managing and Updating Your Website

9Making Updates

Edit Files Directly on GitHub

  1. Navigate to any file in your repository
  2. Click the pencil icon to edit
  3. Make your changes
  4. Scroll down and commit changes

Upload New Files

  • Use the same upload process from Step 5
  • New files will be added, existing files will be updated

Automatic Deployment

  • Changes are automatically deployed to your live website
  • Updates typically appear within 5-10 minutes

10Managing Repository

View Your Website

  • Your website is always accessible at your GitHub Pages URL
  • Share this URL with others to showcase your work

Repository Management

  • Star your repository to bookmark it
  • Watch to get notifications about changes
  • Fork to create copies for experimentation

Troubleshooting Common Issues

Website Not Loading

  • ✅ Ensure your main file is named index.html
  • ✅ Check that GitHub Pages is enabled in Settings
  • ✅ Wait 10-15 minutes for initial deployment
  • ✅ Verify your repository is public

Images Not Displaying

  • ✅ Check image file paths in your HTML
  • ✅ Ensure image files are uploaded to the repository
  • ✅ Use relative paths: images/photo.jpg not C:/Users/...

GitHub Education Benefits Not Working

  • ✅ Ensure you used your .edu email for GitHub account
  • ✅ Wait 72 hours after approval for benefits to activate
  • ✅ Check your application status in Settings → Billing
  • ✅ Contact GitHub Education support if issues persist

File Upload Issues

  • ✅ Check file size limits (100MB per file, 1GB total repository)
  • ✅ Ensure file names don't contain spaces or special characters
  • ✅ Try uploading files one at a time if bulk upload fails

Advanced Tips

Custom Domain (Optional)

If you want to use your own domain name:

  1. Purchase a domain from any domain registrar
  2. Add CNAME file to your repository with your domain name
  3. Configure DNS settings with your domain provider
  4. Update Pages settings in GitHub to use your custom domain

Adding Professional Features

With your educator benefits, you can:

SEO and Optimization

Next Steps and Resources

Expanding Your Skills

  1. Learn Git for advanced version control
  2. Explore Jekyll for blog-style websites
  3. Try GitHub Actions for automated workflows
  4. Join GitHub Community discussions

Additional Resources

Getting Help

Summary Checklist

Congratulations! You've successfully published your AI-generated HTML files to the web using GitHub Pages and unlocked valuable educator benefits. Your website is now live and accessible to anyone with the URL.

Remember to keep your repository updated with new projects and improvements. GitHub Pages makes it easy to maintain a professional web presence for your educational and development work.