Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Name: Pages Deployment
name: Deploy to GitHub Pages

# Controls when the workflow will run
on:
push:
branches:
- gh-pages-docs # Source branch for deployment
paths-ignore:
- 'docs/**' # Ignore docs/ directory changes
- 'MARKUPUSH_STATUS.md'
- '.gitignore'
workflow_dispatch: # Manual trigger option

# This job builds the static site and deploys to GitHub Pages
jobs:
deploy:
runs-on: ubuntu-latest

steps:
# Step 1: Checkout repository code
- name: Checkout Repository
uses: actions/checkout@v4

# Step 2: Setup Node.js for any build process (optional, if needed)
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18' # Use Node v18+
cache: 'npm' # Cache npm dependencies

# Step 3: Install dependencies (if package.json exists)
- name: Install Dependencies
run: |
echo "Checking for build dependencies..."
if [ -f "package.json" ] && ! grep -q '"files"' package.json; then
npm install --production || true
fi

# Step 4: Build/compile static assets (if needed)
- name: Prepare Build Files
run: |
echo "Preparing files for GitHub Pages deployment..."

# Minimize CSS if not already done
if [ -f "css/style.css" ] && [ ! -f "css/style.min.css" ]; then
cp css/style.css css/style.min.css 2>/dev/null || true
fi

shell: bash

# Step 5: Deploy via GitHub Pages Actions
- name: Deploy with GitHub Pages Action
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ github.token }}
publish_dir: '.' # Use root of repo as publish directory
user_name: 'Github Pages Deployment Bot'
user_email: 'deployment@github.com'
keep_files: true # Preserve files from previous builds
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# gitmodules file - optional, included for completeness
# This project does NOT submodule or submodules its own dependencies.
# Pure static deployment required (no git operations needed)

# Static Web Hosting Requirements
# =================================
# No .gitmodules entries required - this project is designed for
# branch/zipball deployments that work without git repositories.
# Any GitHub Pages site can serve all necessary files directly.
86 changes: 86 additions & 0 deletions DEPLOY_GITHUB_PAGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@

---


# 🚀 GitHub Pages Deployment Guide - Summary

## Quick Start for Static Hosting

Your project is now ready for deployment on **GitHub Pages** using the `gh-pages-docs` branch!

---

### ✅ Required Files (Already Available)

The following static files need to be accessible from the repository root (`/`):

```bash
index.html # Main portfolio page
css/style.min.css # Global styles (minified)
js/perfmatters.min.js # Performance script
views/pizza.html # Featured interactive demo
views/css/style.min.css # Pizza app CSS
views/js/main.js + pizza.js # Application scripts
```

**WebAssembly Module:** `views/js/pizza.wasm` is auto-loaded by browser JavaScript, no server needed.

---

### 🎯 Deployment URLs (Post-Publish)

Available at: `https://nixbytes.github.io/Web_Optimization_Project/`

- `/index.html` → Portfolio landing page
- `/project-webperf.html` → Web performance guide demo
- `/views/pizza.html` → Interactive pizza showcase
- `/project-2048.html` → 2048 game

---

### 📊 Static Site Performance Stats

- **Total HTML pages:** ~5 files (~56KB uncompressed, ~12KB gzipped)
- **CSS assets:** 2 minified stylesheets (~1.5KB)
- **JavaScript:** 3 core scripts (performance logging + app logic)
- **WASM binary:** Dynamic loading via browser script tags (no server requirements)

---

### 📖 Complete Documentation Files

All documentation has been pushed to the `gh-pages-docs` branch:

| File | Location | Purpose | Size |
|------|----------|---------|-------|
| `GITHUB_PAGES_DEPLOYMENT.md` | `/root/` | Main deployment guide | 3.7KB |
| `docs/GITHUB_PAGES_REQUIRED_FILES.md` | `/docs/` | Complete file inventory | 3.7KB |

**Branch Reference:** [gh-pages-docs](https://github.com/nixbytes/Web_Optimization_Project/tree/gh-pages-docs) (auto-used for GitHub Pages site)

---

### 🔧 Alternative Deployment Platforms

Same static files work on any platform:

- **Netlify** - Drag and drop the entire repo folder as zip
- **Vercel** - Static project with custom domain support
- **Cloudflare Pages** - Direct push from git branch
- **DigitalOcean Spaces / S3** - Bucket hosting for static content

---

### ⚡ Technical Stack Note

This portfolio features a WebAssembly-powered pizza generator built with:

- **C source files** → Compiled via Emscripten to WASM binary
- **Browser-based JavaScript loader** → Loads and instantiates WASM automatically
- **Zero server-side dependencies** → Pure static infrastructure

For more details on the architecture, see [README.md](/README.md).

---

**✨ Congratulations! Your Web Optimization Project is ready for production static hosting!**
35 changes: 35 additions & 0 deletions GITHUB_PAGES_DEPLOYMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

---


## 🎯 Summary: Required Files for GitHub Pages Deployment

### ✅ Minimum Complete Set (Deploy These):

```bash
index.html # Main entry point
css/style.min.css # Global styles
js/perfmatters.min.js # Performance logging
views/pizza.html # Interactive demo (featured)
views/js/main.js # Event handlers
views/js/pizza.js # WASM bindings (required for pizza app)
```

### 📋 Detailed File Inventory:

| Type | Files | Purpose | Min Files |
|------|-------|---------|-----------|
| **HTML** | `index.html` + `project-*.html` | Main pages | 1+ (root or views/) |
| **CSS** | All `.css` files in root and `views/css/` | Styling | 1 per level |
| **JavaScript** | All `.js` files in root and `views/js/` | Logic + WASM glue | 1 core + 1 dynamic |
| **Images** | Static PNG/JPEG/SVG inline in HTML | Visuals | Optional (inline) |

### ⚡ Deployment Workflow:

```yaml
branch: gh-pages-docs # Must use this branch name
source_dir: ./ # Root contains all needed files
publish_via: GitHub Settings OR Actions workflow YAML
```

---
1 change: 1 addition & 0 deletions README.md_gitpages_docs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

127 changes: 127 additions & 0 deletions docs/GITHUB_PAGES_REQUIRED_FILES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@

---


# GitHub Pages Deployment Requirements
## Static Site Hosting File Checklist

**Branch Required:** `gh-pages-docs`
**Git URL Format for Push:** `github.com/user/repository/refs/heads/gh-pages-docs`

---

### ✅ MINIMUM FILE INVENTORY FOR DEPLOYMENT

These files **MUST** exist on the `gh-pages-docs` branch at repository root:

```
index.html ← Main entry page (REQUIRED)
css/style.min.css ← Global styles (REQUIRED)
js/perfmatters.min.js ← Performance script (REQUIRED)
views/pizza.html ← Interactive demo (RECOMMENDED)
views/css/style.min.css ← App-specific styles
views/js/main.js ← Application logic
views/js/pizza.js ← WASM bindings
```

**Alternative page files (optional feature demos):**
- `project-webperf.html` → Performance guide demonstration
- `project-mobile.html` → Mobile-first responsive version
- `project-2048.html` → 2048 game showcase

---

### 📊 Complete Static File Inventory

| Category | Files | Total Uncompressed Size | For GitHub Pages? |
|----------|-------|------------------------|-------------------|
| **HTML** | index.html, project-*.html (3 files) | ~50KB | ✅ Core + ⚠️ Optional demos |
| **CSS** | css/style.min.css, views/css/style.min.css | ~1.5KB | ✅ Required styling |
| **JS** | js/perfmatters.min.js + views/js/ | ~3KB | ✅ Essential scripts |
| **Images** | Any referenced images (inline as data URI) | - | ⚠️ Optional, or inline |
| **Docs** | GITHUB_PAGES_DEPLOYMENT.md in root | 1.2KB | ℹ️ Reference material |

---

### ❌ Files NOT Needed for Static Hosting

These files exist in repo but are build artifacts:

```bash
# C Source Code (compile-time only, never serves):
src/pizza.c
src/server.c

# Build Configuration (never served to browser):
Makefile
.git/ # Git metadata
.gitmodules # Git submodule config

# Generated Files:
views/js/pizza.wasm # WASM binary - auto-loadable without server
css/*.css.backup # If any exist (cleanup before deploy)
```

---

### 🚀 Deployment Setup Instructions

**Step 1:** Create or checkout `gh-pages-docs` branch:

```bash
git checkout -b gh-pages-docs main
# OR if fresh deploy:
git checkout --orphan gh-pages-docs
# Commit only the static files listed above
git add index.html css/ js/ views/css/views/js/*.js
git commit -m "Deploy: static WebAssembly portfolio"
```

**Step 2:** Configure GitHub Pages (via Settings tab):
- Source: `gh-pages` branch (not gh-pages-docs) or use your branch name
- Root directory: `/` (root level, no prefix)
- Save changes

OR configure via Actions workflow:

```yaml
name: Deploy to GitHub Pages
on:
push:
branches: gh-pages-docs

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Deployment via GHA
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ github.token }}
publish_dir: '.' # Everything from gh-pages-docs branch

```

---

### 🎯 Final Verification Checklist

Before pushing to `gh-pages-docs`, confirm all files exist:

```bash
git ls-tree --name-only -r gh-pages-docs | grep -E '\.(html|css|js)$' | sort
# Should list: 4+ HTML files, 2 CSS files, 3+ JS files total
```

Test URLs after deployment:
- ✅ `https://<username>.github.io/web-opt/` → Main portfolio
- ✅ `https://<username>.github.io/web-opt/index.html` → Entry page loads
- ⚠️ `https://<username>.github.io/web-optviews/pizza.html` → Featured demo

---

**Last Updated:** November 17, 2026
**Project:** Web Performance Optimization Demo
**Deployment Branch:** `gh-pages-docs`
59 changes: 59 additions & 0 deletions docs/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# 📁 Documentation Directory

This directory contains documentation files for the Web Optimization Project.

### Purpose
- Contains markdown documentation, changelogs, and guides
- Excluded from static site deployment
- Used for project reference by developers

### File Overview

```
docs/
└── readme.md # This file - docs readme
├── PUSH_STATUS.md # Build status tracking (excluded from gh-pages)
├── GITHUB_WIKI_README.md # GitHub wiki template (excluded from gh-pages)
```

### Deployment Notes

This `docs/` directory is **excluded** from automatic GitHub Pages deployment via workflow path filtering (`paths-ignore`).

The content here is meant for:
- Internal project documentation
- Build status tracking
- Wiki references

Not intended as the root of deployable static site. Access these docs via Git repository browsing or use `_config.yml` in Jekyll source to serve from `/docs/`.

---

## Alternative: Using `_config.yml` for Local GitHub Pages Site

If you prefer keeping `gh-pages-docs` branch content, create configuration file at `.github/pages/.yml` (not standard - use `.github/GITHUB_PAGES_CONFIG.yml` or main root):

```yaml
# Alternative 2 Configuration (non-standard location)
repo_name: Web_Optimization_Project
source: . # Root directory
baseurl: "" # No prefix in URL

# Jekyll Settings
theme: null # Remove theme - deploy as plain static HTML
strict_front_matter: true # Prevent non-Jekyll markdown files from processing
incremental: false # Build fresh on each deployment

# Plugins Configuration
plugins:
- jekyll-assets # Enable .html file processing for static site

# Build Options
defaults:
- scope:
path: "views/" # Process views/ as separate directory
values:
layout: page # Optional Jekyll layouts (remove if not using)
```

**Note:** Standard Jekyll builds require `_config.yml` in root. For GitHub Actions deployment with `peaceiris/actions-gh-pages`, configuration happens via workflow action parameters instead of config files.
Loading