Ratatoskr/.github/workflows/rat-dev-preview.yml
Void 7a896c5f93 preview: pretend homeserver for the dev preview, in-page and off by default
src/preview-demo answers a demo.invalid homeserver from fixtures through a guarded fetch;
own-origin requests pass, every other origin is refused (fetch, WebSocket, XHR, beacon).
Built in only with VITE_PREVIEW_DEMO=1 and switched on by previewDemo in config.json
(scripts/preview-config.js --demo, run by the dev workflow). Login prefills 'demo'.
Pose art: 24 downscaled thumbnails in preview-demo/poses, copied into dist by the workflow.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 18:49:59 +00:00

39 lines
1.3 KiB
YAML

name: Rat dev preview
on:
push:
branches: ['dev']
jobs:
build:
name: Build dev preview
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: ".node-version"
package-manager-cache: false
- name: Install dependencies
run: npm ci
- name: Build app
env:
CINNY_BASE: /void/rat-dev/
VITE_PREVIEW_DEMO: '1'
NODE_OPTIONS: '--max_old_space_size=3072'
run: npm run build
- name: Set background scene tier and the pretend homeserver
run: node scripts/preview-config.js low --demo
- name: Add the demo pose art
run: mkdir -p dist/public/poses && cp -r preview-demo/poses/. dist/public/poses/
- name: Upload artifact
# v3 protocol: the v4 client keeps only the origin of ACTIONS_RESULTS_URL, dropping this forge's /forge subpath
# (nginx 404 page, runs 170-171), and upstream v4+ refuses non-GitHub servers outright (run 169).
uses: forgejo/upload-artifact@v3
with:
name: rat-dev-dist
path: dist
retention-days: 3