Skip to content

Commit 80ea96f

Browse files
committed
feat: Switch preview captures from GIF to MP4 with GitHub Release storage
1 parent b41fc64 commit 80ea96f

3 files changed

Lines changed: 226 additions & 64 deletions

File tree

.github/workflows/showcase_capture-previews.yml

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@ concurrency:
2525
group: showcase-capture-${{ github.ref }}
2626
cancel-in-progress: true
2727

28+
permissions:
29+
contents: write
30+
2831
jobs:
2932
capture:
30-
name: Capture Preview GIFs
33+
name: Capture Preview MP4s
3134
runs-on: ubuntu-latest
32-
# Disabled — preview GIFs removed from repo, awaiting external storage setup
33-
if: false
35+
# Captures demo previews as MP4 and uploads to GitHub release
3436
timeout-minutes: 30
3537
steps:
3638
- name: Checkout
@@ -40,6 +42,16 @@ jobs:
4042
ref: ${{ github.event.workflow_run.head_branch || github.ref }}
4143
token: ${{ secrets.GITHUB_TOKEN }}
4244

45+
- name: Ensure preview release exists
46+
env:
47+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
run: |
49+
gh release view showcase-previews --repo ${{ github.repository }} >/dev/null 2>&1 || \
50+
gh release create showcase-previews --repo ${{ github.repository }} \
51+
--title "Showcase Preview Videos" \
52+
--notes "Auto-generated demo preview videos for the showcase platform. Updated by CI." \
53+
--latest=false
54+
4355
- name: Setup Node.js
4456
uses: actions/setup-node@v4
4557
with:
@@ -89,22 +101,15 @@ jobs:
89101
npx tsx showcase/scripts/capture-previews.ts $ARGS || true
90102
fi
91103
92-
- name: Update manifests and registry
93-
run: |
94-
# Check if any new GIFs were created that need manifest updates
95-
if git diff --name-only | grep -q "previews/"; then
96-
# Regenerate registry from updated manifests
97-
npx tsx showcase/scripts/generate-registry.ts || true
98-
fi
99-
100-
- name: Commit and push
104+
- name: Commit registry updates
101105
run: |
102106
git config user.name "github-actions[bot]"
103107
git config user.email "github-actions[bot]@users.noreply.github.com"
104-
git add showcase/shell/public/previews/ showcase/shell/src/data/registry.json showcase/packages/*/manifest.yaml
105-
if git diff --staged --quiet; then
106-
echo "No preview changes to commit"
108+
cd showcase/shell/src/data
109+
if git diff --quiet registry.json; then
110+
echo "No registry changes"
107111
else
108-
git commit -m "Auto-capture preview GIFs for updated demos"
112+
git add registry.json
113+
git commit -m "Update preview URLs in registry"
109114
git push
110115
fi

0 commit comments

Comments
 (0)