fix(assets): regenerate social preview and og-image cards to Joltrin … #22
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 SOP Pages (Technical Demo + Arena) | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| paths: | |
| - 'demo/**' | |
| - 'demo-agents/**' | |
| - 'sop-arena/**' | |
| - '.github/workflows/deploy-demo.yml' | |
| workflow_dispatch: # Allows manual trigger from the GitHub Actions UI | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
| # However, do NOT cancel in-progress runs as we want to allow deployments to complete safely. | |
| # | |
| # This is the ONLY workflow in the repository that publishes to the | |
| # "github-pages" environment. It builds both experiences into one combined | |
| # artifact and deploys them together, on purpose: GitHub Pages workflow | |
| # deployments fully replace the site's content each time, so two separate | |
| # workflows publishing separately (as this repo used to do, plus a third | |
| # Jekyll-based Pages step that was in promote.yml) just overwrite each | |
| # other's output on whichever one runs last. See CHANGELOG.md for that fix. | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build-and-package: | |
| name: Build WASM Demo + SOP Arena, Package Site | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Go Toolchain | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: 'go.mod' | |
| cache: true | |
| - name: Copy Go WebAssembly JavaScript Support (wasm_exec.js) | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| GOROOT="$(go env GOROOT)" | |
| echo "Locating wasm_exec.js in GOROOT: ${GOROOT}" | |
| # Support modern Go (lib/wasm) and legacy Go (misc/wasm) locations | |
| if [ -f "${GOROOT}/lib/wasm/wasm_exec.js" ]; then | |
| cp "${GOROOT}/lib/wasm/wasm_exec.js" demo/wasm_exec.js | |
| cp "${GOROOT}/lib/wasm/wasm_exec.js" demo-agents/wasm_exec.js | |
| echo "Copied from ${GOROOT}/lib/wasm/wasm_exec.js" | |
| elif [ -f "${GOROOT}/misc/wasm/wasm_exec.js" ]; then | |
| cp "${GOROOT}/misc/wasm/wasm_exec.js" demo/wasm_exec.js | |
| cp "${GOROOT}/misc/wasm/wasm_exec.js" demo-agents/wasm_exec.js | |
| echo "Copied from ${GOROOT}/misc/wasm/wasm_exec.js" | |
| else | |
| echo "Error: wasm_exec.js not found in ${GOROOT}" >&2 | |
| exit 1 | |
| fi | |
| - name: Compile Go Engine to WebAssembly (sop.wasm) | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| echo "Compiling SOP embedded engine to WebAssembly..." | |
| cd demo | |
| # -s -w strips symbol tables and debug information to minimize binary footprint | |
| GOOS=js GOARCH=wasm go build -ldflags="-s -w" -o sop.wasm . | |
| ls -lh sop.wasm wasm_exec.js index.html | |
| - name: Compile Agent Verification Barrier to WebAssembly (sop-agents.wasm) | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| echo "Compiling ai/verify barrier demo to WebAssembly..." | |
| cd demo-agents | |
| GOOS=js GOARCH=wasm go build -ldflags="-s -w" -o sop-agents.wasm . | |
| ls -lh sop-agents.wasm wasm_exec.js index.html | |
| - name: Setup Node.js Toolchain | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| cache-dependency-path: 'sop-arena/package-lock.json' | |
| - name: Install SOP Arena Dependencies | |
| working-directory: ./sop-arena | |
| run: npm ci || npm install | |
| - name: Build SOP Arena | |
| working-directory: ./sop-arena | |
| run: npm run build | |
| - name: Assemble Combined Site | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| rm -rf _site | |
| mkdir -p _site/arena _site/agents | |
| # Technical demo (WASM) lives at the site root: sharedcode.github.io/joltrin/ | |
| cp demo/index.html demo/sop.wasm demo/wasm_exec.js demo/404.html demo/favicon.svg demo/favicon.ico _site/ | |
| # SOP Arena lives at a subpath of the same site: sharedcode.github.io/joltrin/arena/ | |
| cp -r sop-arena/dist/. _site/arena/ | |
| # Agent verification barrier (ai/verify in WASM) lives at sharedcode.github.io/joltrin/agents/ | |
| cp demo-agents/index.html demo-agents/sop-agents.wasm demo-agents/wasm_exec.js demo-agents/favicon.svg demo-agents/favicon.ico _site/agents/ | |
| ls -lh _site _site/arena _site/agents | |
| - name: Setup GitHub Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Upload GitHub Pages Artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: './_site' | |
| deploy: | |
| name: Deploy to GitHub Pages | |
| needs: build-and-package | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |