Repository navigation
Sync Missing YouTube Transcripts #22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Sync Missing YouTube Transcripts | |
| on: | |
| schedule: | |
| - cron: "0 * * * *" # Run hourly | |
| workflow_dispatch: | |
| inputs: | |
| dataset: | |
| description: "Target Sanity Dataset" | |
| required: true | |
| default: "production" | |
| type: choice | |
| options: | |
| - production | |
| - dev | |
| batch_size: | |
| description: "Batch size (number of videos to process in this run)" | |
| required: true | |
| default: "50" | |
| type: string | |
| jobs: | |
| sync-transcripts: | |
| runs-on: ubuntu-latest | |
| environment: production | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: ".nvmrc" | |
| cache: "pnpm" | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run Missing YouTube Transcripts Sync | |
| run: | | |
| pnpm exec sanity functions test sync-missing-youtube-transcripts --dataset ${{ inputs.dataset }} | |
| env: | |
| SANITY_AUTH_TOKEN: ${{ secrets.SANITY_AUTH_TOKEN }} | |
| SANITY_API_WRITE_TOKEN: ${{ secrets.SANITY_API_WRITE_TOKEN }} | |
| SANITY_STUDIO_PROJECT_ID: ${{ vars.SANITY_STUDIO_PROJECT_ID }} | |
| SANITY_STUDIO_DATASET: ${{ inputs.dataset }} | |
| YOUTUBE_API_KEY: ${{ secrets.YOUTUBE_API_KEY }} | |
| SYNC_BATCH_SIZE: ${{ inputs.batch_size }} |