Skip to content

feat(video): show live conversion progress (#145) #8

feat(video): show live conversion progress (#145)

feat(video): show live conversion progress (#145) #8

Workflow file for this run

name: Deploy Cloudflare production
on:
push:
branches:
- master
workflow_dispatch:
permissions:
contents: read
concurrency:
group: hackweek-cloudflare
cancel-in-progress: false
jobs:
verify:
if: github.ref == 'refs/heads/master'
uses: ./.github/workflows/test.yml
deploy:
name: Deploy production
needs: verify
runs-on: ubuntu-latest
environment: hackweek-cloudflare
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24.19.0
cache: npm
- run: npm ci --no-audit --no-fund
- name: Validate required configuration
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run: |
test -n "$CLOUDFLARE_API_TOKEN" || { echo 'Missing CLOUDFLARE_API_TOKEN'; exit 1; }
test "$CLOUDFLARE_ACCOUNT_ID" = '20d94f53c7cab0b469521b703ff1923c' || { echo 'Unexpected Cloudflare account'; exit 1; }
node -e "const c=require('./wrangler.production.json'); const videos=c.r2_buckets.find(x=>x.binding==='VIDEOS'); const workflow=c.workflows.find(x=>x.binding==='VIDEO_PROCESSING_WORKFLOW'); const container=c.containers.find(x=>x.class_name==='VideoProcessorContainer'); if (c.account_id !== '20d94f53c7cab0b469521b703ff1923c' || videos?.bucket_name !== 'hackweek-video-media-production' || workflow?.name !== 'hackweek-video-processing-production' || container?.name !== 'hackweek-video-processor-production' || container?.max_instances !== 5 || c.vars.VIDEO_PROCESSOR_CONCURRENCY !== '2') process.exit(1); for (const value of [c.d1_databases[0].database_id,c.r2_buckets[0].bucket_name,c.vars.APP_ORIGIN,c.vars.GOOGLE_REDIRECT_URI,c.vars.GOOGLE_CLIENT_ID]) if (!value || /replace.me/i.test(value) || value === '00000000-0000-0000-0000-000000000000') process.exit(1)"
- run: npm run build
- name: Apply expand-compatible D1 migrations
run: npx wrangler d1 migrations apply hackweek-db --remote --config wrangler.production.json
env: &cloudflare
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
- name: Deploy Worker and static assets
run: npx wrangler deploy --config wrangler.production.json
env: *cloudflare