Skip to content

feat(readers): be more generous — unblock 13+ datasets from the 648-d… #126

feat(readers): be more generous — unblock 13+ datasets from the 648-d…

feat(readers): be more generous — unblock 13+ datasets from the 648-d… #126

Workflow file for this run

name: Deploy to GitHub Pages
# Static-only deploy: the viewer is plain HTML / JS / CSS, no build
# step. We stage the user-facing assets into `_site/` so dev-only
# directories (tests, scripts, node_modules, .github) never ship.
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
# Only one Pages deploy in flight at a time. Don't cancel an in-flight
# deploy on a new push — the deploy step is fast, and aborting halfway
# through can leave the Pages site in a partial state.
concurrency:
group: pages
cancel-in-progress: false
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'
jobs:
build:
name: Build artifact
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Stage user-facing assets
run: |
mkdir -p _site
# NOTE: topo2d.js was archived to archive/topo2d/ — drop from cp.
# Lane E + F decomposition added sub-module directories that must
# be staged alongside their parent files:
# viewer/ — worker-rpc, render-pipeline, render-helpers, url-resolver
# bids-recording/ — nemar
# traces/ — event-markers, scale-bar
cp -r index.html viewer.js traces.js \
bids-loader.js bids-recording.js \
worker.js filters.js perf.js \
styles.css eegdash-logo.svg \
formats viewer bids-recording traces \
_site/
# Sanity gate: every <script src="..."> referenced from
# index.html must exist under _site/. Catches the regression
# where worker.js / filters.js / perf.js were added to the
# repo (commits ade49a5, 4aa8d6f, 2beb279) but not to this
# cp allowlist — the deployed viewer was loading viewer.js
# but failing to spawn its worker, breaking traces entirely.
missing=()
while IFS= read -r src; do
case "$src" in
http*) continue ;; # external URL, e.g. fonts
"") continue ;;
esac
test -f "_site/${src%%\?*}" || missing+=("$src")
done < <(grep -oE 'src="[^"]+\.js[^"]*"' index.html | sed -E 's/src="([^"]+)"/\1/')
if [ ${#missing[@]} -gt 0 ]; then
echo "::error::index.html references files not staged in _site/: ${missing[*]}"
exit 1
fi
- uses: actions/configure-pages@v5
- uses: actions/upload-pages-artifact@v3
with:
path: _site
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4