A simple, clean, fast browser for the AtmosphereConf(2026) VODs
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 8777bc69a168f461e91c054c6ee5824cb2e3d9ed 84 lines 2.6 kB view raw
1name: Refresh Embeddings Index 2 3on: 4 push: 5 branches: 6 - main 7 paths: 8 - '.github/workflows/refresh-embeddings.yml' 9 - 'scripts/generate-video-embeddings.mjs' 10 - 'src/lib/video-taxonomy.json' 11 - 'package-lock.json' 12 - 'package.json' 13 schedule: 14 - cron: '15 */12 * * *' 15 workflow_dispatch: 16 17permissions: 18 contents: write 19 20jobs: 21 refresh-embeddings: 22 runs-on: ubuntu-latest 23 24 steps: 25 - name: Checkout main 26 uses: actions/checkout@v4 27 with: 28 fetch-depth: 0 29 30 - name: Setup Node 31 uses: actions/setup-node@v4 32 with: 33 node-version: '20' 34 cache: npm 35 36 - name: Install dependencies 37 run: npm ci 38 39 - name: Fetch latest embeddings-data branch 40 run: | 41 git fetch origin embeddings-data || true 42 43 - name: Prepare previous embeddings snapshot 44 run: | 45 mkdir -p .cache 46 if git show-ref --verify --quiet refs/remotes/origin/embeddings-data; then 47 git show origin/embeddings-data:video-embeddings.json > .cache/previous-video-embeddings.json || true 48 fi 49 50 - name: Generate incremental embeddings index 51 env: 52 OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} 53 OPENROUTER_EMBEDDING_MODEL: qwen/qwen3-embedding-8b 54 EXISTING_EMBEDDINGS_PATH: .cache/previous-video-embeddings.json 55 EMBEDDINGS_OUTPUT_PATH: video-embeddings.json 56 run: npm run embeddings:generate 57 58 - name: Detect index changes 59 id: diff 60 run: | 61 if [ -f .cache/previous-video-embeddings.json ] && cmp -s .cache/previous-video-embeddings.json video-embeddings.json; then 62 echo "changed=false" >> "$GITHUB_OUTPUT" 63 else 64 echo "changed=true" >> "$GITHUB_OUTPUT" 65 fi 66 67 - name: Publish embeddings-data branch 68 if: steps.diff.outputs.changed == 'true' 69 env: 70 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 71 run: | 72 mkdir -p .out 73 cp video-embeddings.json .out/video-embeddings.json 74 git checkout --orphan embeddings-data 75 git rm -rf . >/dev/null 2>&1 || true 76 cp .out/video-embeddings.json ./video-embeddings.json 77 rm -rf .out 78 git add video-embeddings.json 79 git -c user.name="jack" -c user.email="jack@j4ck.xyz" commit -m "chore: refresh embeddings index" 80 git push --force-with-lease origin embeddings-data 81 82 - name: No changes 83 if: steps.diff.outputs.changed != 'true' 84 run: echo "No embedding updates required."