Skip to content

Nightly Tier Upgrade #77

Nightly Tier Upgrade

Nightly Tier Upgrade #77

name: Nightly Tier Upgrade
on:
schedule:
# Run at 02:00 UTC every night
- cron: '0 2 * * *'
workflow_dispatch:
inputs:
dry_run:
description: 'Dry run (no DB writes)'
required: false
default: 'false'
jobs:
tier-upgrade:
name: Upgrade creator verification tiers
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Generate Prisma client
run: pnpm exec prisma generate
- name: Run tier upgrade
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
DRY_RUN: ${{ github.event.inputs.dry_run || 'false' }}
run: |
pnpm exec tsx lib/cron/tier-upgrade.ts
- name: Notify on failure
if: failure()
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: 832,
body: '⚠️ Nightly tier upgrade failed. Check the [workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for details.'
})