Repository navigation
repo fixes for github pages #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy Test Harness to GitHub Pages | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: true | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Build Tailwind CSS | |
| run: | | |
| npm install --no-audit --no-fund | |
| npm run build:css | |
| - name: Prepare site | |
| run: | | |
| mkdir _site | |
| cp test-harness.html _site/index.html | |
| cp harness-manifest.json _site/ | |
| # Copy root-level assets (logo, etc.) | |
| cp -f *.png _site/ 2>/dev/null || true | |
| # Copy shared assets (fonts, etc.) | |
| [ -d shared ] && cp -r shared _site/ | |
| # Copy viz source, harness descriptors, and extra data files | |
| for viz in examples/*/; do | |
| viz_name=$(basename "$viz") | |
| viz_dir="examples/$viz_name/appserver/static/visualizations/$viz_name" | |
| if [ -f "$viz_dir/harness.json" ]; then | |
| dest="_site/$viz_dir" | |
| mkdir -p "$dest/src" | |
| cp "$viz_dir/harness.json" "$dest/" | |
| cp "$viz_dir/src/visualization_source.js" "$dest/src/" | |
| # Copy visualization.css if it exists | |
| [ -f "$viz_dir/visualization.css" ] && cp "$viz_dir/visualization.css" "$dest/" | |
| # Copy extra data files (json, csv, png — exclude node_modules, src, package files) | |
| find "$viz_dir" -maxdepth 1 -type f \( -name "*.json" -o -name "*.csv" -o -name "*.png" \) \ | |
| ! -name "harness.json" ! -name "package.json" ! -name "package-lock.json" \ | |
| -exec cp {} "$dest/" \; | |
| # Copy app icons (static/) for asset preview in test harness | |
| if [ -d "examples/$viz_name/static" ]; then | |
| mkdir -p "_site/examples/$viz_name/static" | |
| cp examples/$viz_name/static/appIcon*.png "_site/examples/$viz_name/static/" 2>/dev/null || true | |
| fi | |
| fi | |
| done | |
| - uses: actions/configure-pages@v5 | |
| with: | |
| enablement: true | |
| - uses: actions/upload-pages-artifact@v4 | |
| - id: deployment | |
| uses: actions/deploy-pages@v4 |