webgl: 新 app — 说需求→gemma 流式生成可交互 WebGL 小程序
deploy articulate / build-and-deploy (push) Successful in 2m7s
deploy cube / build-and-deploy (push) Successful in 2m36s
deploy karaoke / build-and-deploy (push) Successful in 1m38s
deploy llm-proxy / build-and-deploy (push) Successful in 3m29s
deploy music / build-and-deploy (push) Successful in 3m45s
deploy notes / build-and-deploy (push) Successful in 2m43s
deploy simpleasm / build-and-deploy (push) Successful in 1m54s
deploy webgl / build-and-deploy (push) Successful in 1m50s
deploy werewolf / build-and-deploy (push) Successful in 1m27s
deploy write / build-and-deploy (push) Successful in 2m18s

左 sidebar 聊天说需求,右主区 运行/代码 两 tab。后端 SSE 流式把
gemma 生成的自包含纯原生 WebGL HTML 一段段回吐,前端实时显示代码、
写完丢进沙箱 iframe 跑。完全无状态(迭代靠前端回传 current_code)。
给儿子体验 WebGL。
This commit is contained in:
Fam Zheng
2026-06-03 22:21:33 +01:00
parent cf360f0193
commit 4336cde189
20 changed files with 2574 additions and 0 deletions
+57
View File
@@ -0,0 +1,57 @@
name: deploy webgl
# webgl.famzheng.me — 说需求现场生成可交互 WebGL 小程序。host shell runnerfam 用户)。
on:
push:
branches: [master]
paths:
- 'apps/webgl/**'
- 'crates/cube-core/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.gitea/workflows/deploy-webgl.yml'
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
env:
APP: webgl
IMAGE: registry.famzheng.me/mochi/webgl
steps:
- uses: actions/checkout@v4
- name: Resolve image tag
id: tag
run: |
echo "sha=$(git rev-parse --short=12 HEAD)" >> "$GITHUB_OUTPUT"
- name: Build rust (musl static)
run: |
export PATH="$HOME/.cargo/bin:$PATH"
cargo build --release --target x86_64-unknown-linux-musl -p "$APP"
- name: Build frontend
run: |
cd "apps/$APP/frontend"
npm ci
npm run build
- name: Build & push image
env:
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
run: |
echo "$REGISTRY_TOKEN" | docker login registry.famzheng.me -u mochi --password-stdin
# FROM scratch + COPY musl binary —— 必须 --no-cache,否则 docker layer cache
# 会把 COPY binary 这层套用历史 binarycube 平台踩过的坑)。
docker build --no-cache -f "apps/$APP/Dockerfile" -t "$IMAGE:${{ steps.tag.outputs.sha }}" .
docker push "$IMAGE:${{ steps.tag.outputs.sha }}"
- name: Initialize K8s resources
run: |
kubectl apply -f "apps/$APP/k8s/all.yaml"
- name: Roll out to k3s
run: |
kubectl -n "cube-$APP" set image "deploy/$APP" "$APP=$IMAGE:${{ steps.tag.outputs.sha }}"
kubectl -n "cube-$APP" rollout status "deploy/$APP" --timeout=120s