From efababe3975fe21fa46c5775d42e93917cde5a47 Mon Sep 17 00:00:00 2001 From: David Snelling Date: Mon, 23 Jun 2025 11:26:11 -0700 Subject: [PATCH] **feat(demo): add GitHub Pages demo script and update deployment workflow** ### Changes: - **`demo/simplified-augmentations-gh-pages.js`**: - Added a new demo script showcasing simplified augmentations for GitHub Pages. - Includes examples for static and streaming data processing, WebSocket support, and dynamic augmentation loading. - **`README.md`**: - Updated the demo link to point directly to `https://soulcraft-research.github.io/brainy/`. - **`.github/workflows/deploy-demo.yml`**: - Enhanced the deployment workflow to include the `simplified-augmentations-gh-pages.js` file as the GitHub Pages demo entry point. - Added steps to copy and prepare required `dist` files during the build process. - **`demo/index.html`**: - Dynamically adjusted the import path for the Brainy library to support both local and CDN environments. - Reformatted code for readability and alignment with deployment needs. ### Purpose: Introduced a tailored demonstration script for GitHub Pages to highlight Brainy's streamlined augmentation features. Enhanced the deployment pipeline for better integration and seamless live demo experience. --- .github/workflows/deploy-demo.yml | 7 + README.md | 2 +- demo/index.html | 21 +- demo/simplified-augmentations-gh-pages.js | 390 ++++++++++++++++++++++ 4 files changed, 412 insertions(+), 8 deletions(-) create mode 100644 demo/simplified-augmentations-gh-pages.js diff --git a/.github/workflows/deploy-demo.yml b/.github/workflows/deploy-demo.yml index 10b4e5ed..d9ddcc08 100644 --- a/.github/workflows/deploy-demo.yml +++ b/.github/workflows/deploy-demo.yml @@ -27,6 +27,13 @@ jobs: run: | npm run build npm run build:browser + mkdir -p demo/dist + cp dist/unified.js demo/dist/ + cp dist/unified.min.js demo/dist/ + cp dist/brainy.js demo/dist/ + cp dist/brainy.min.js demo/dist/ + # Use the GitHub Pages specific version of simplified-augmentations.js + cp demo/simplified-augmentations-gh-pages.js demo/simplified-augmentations.js - name: Deploy to GitHub Pages 🚀 uses: JamesIves/github-pages-deploy-action@v4 diff --git a/README.md b/README.md index 33fb425a..117de6ad 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ it gets - learning from your data to provide increasingly relevant results and c ## 🚀 Live Demo -**[Try the live demo](https://soulcraft-research.github.io/brainy/examples/)** - Check out the interactive demo on +**[Try the live demo](https://soulcraft-research.github.io/brainy/)** - Check out the interactive demo on GitHub Pages that showcases Brainy's main features. ## 📊 What Can You Build? diff --git a/demo/index.html b/demo/index.html index 23bf8c24..a63814bc 100644 --- a/demo/index.html +++ b/demo/index.html @@ -1091,8 +1091,15 @@ await db.init()