### 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.
43 lines
1.1 KiB
YAML
43 lines
1.1 KiB
YAML
name: Deploy Demo to GitHub Pages
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Checkout 🛎️
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup Node.js 🔧
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '23'
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies 📦
|
|
run: npm install --legacy-peer-deps
|
|
|
|
- name: Build project 🏗️
|
|
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
|
|
with:
|
|
folder: demo
|
|
branch: gh-pages
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|