safelibrary-upload-pgs

HouseLearning Pages Hosting

Static hosting platform on top of GitHub Pages:

URLs

Deployed sites live under:

You can later add a nicer alias layer like:

Setup

  1. Clone this repo into GitHub (e.g. HouseLearning/pages-hosting).
  2. Enable GitHub Pages:
    • Source: main branch
    • Folder: / (root) or /public depending on how you host
  3. Firebase:
    • Create a Firebase project
    • Enable Email/Password or other providers
    • Create Firestore in production mode
    • Copy your config into public/js/firebase-init.js
  4. GitHub Secrets:
    • PAGES_PAT: Personal Access Token with repo scope
    • PAGES_REPO: owner/repo (e.g. HouseLearning/pages-hosting)
    • PAGES_BRANCH: usually main
  5. Deploy:
    • Push to GitHub
    • Visit https://<your-gh-pages-domain> (or custom domain pages.houselearning.org)

Firestore structure (logical)

You can adapt this to your existing Blob system.

Workflow

  1. User logs in.
  2. User creates a site (up to 5).
  3. User uploads files (HTML/CSS/JS).
  4. User clicks “Deploy”.
  5. Frontend calls GitHub REST API repository_dispatch with payload:
    • uid, siteId, files[]
  6. GitHub Action:
    • Writes files into /sites/{uid}/{siteId}/
    • Commits and pushes
    • GitHub Pages serves them.