#!/bin/sh # Slice H preview: compose + build the homepage from the primary's real data, deploy to the Pages preview branch "refresh". cd /home/user/Projects/yt-dlp-transcript-browser || exit 1 T=${CLAUDE_JOB_DIR:?set CLAUDE_JOB_DIR}/tmp; REL=${REL:-r9} echo "START $(date +%T) $(git rev-parse --short HEAD)" s=$(date +%s); pnpm --filter yt-dlp-transcript-common exec tsx bin/archilyzer.ts build homepage > $T/$REL-home-preview-build.log 2>&1; echo "build_homepage_exit=$? $(( $(date +%s)-s ))s summary_version=$(jq -r '.version // "?"' homepage/public/homepage-summary.json) monthly=$(jq -r '.monthly|length' homepage/public/homepage-summary.json 2>/dev/null)" s=$(date +%s); pnpm --filter yt-dlp-transcript-common exec tsx bin/archilyzer.ts deploy homepage --preview refresh > $T/$REL-home-preview-deploy.log 2>&1; echo "deploy_preview_exit=$? $(( $(date +%s)-s ))s $(grep -o 'https://[a-z0-9.-]*archilyzer.pages.dev' $T/$REL-home-preview-deploy.log | tail -2 | tr '\n' ' ')" echo "exit=0 $(date +%T)"