Update scores cronjob #6181
This file contains 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: Update scores cronjob | |
on: | |
schedule: | |
- cron: "*/30 * * * *" | |
jobs: | |
update-scores: | |
runs-on: ubuntu-20.04 | |
name: Update scores | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v4 | |
name: Configure node | |
with: | |
node-version: '20.12.2' | |
- name: Install dependencies | |
if: steps.yarn-cache.outputs.cache-hit != 'true' | |
run: rm yarn.lock package.json .yarnrc.yml && npm install node-fetch dayjs blitz @prisma/client && npx --yes prisma generate --schema='./db/schema.prisma' | |
- name: Update scores | |
run: DATABASE_URL=${{env.DATABASE_URL}} npx --yes tsx ./db/updateScores.ts | |
env: | |
DATABASE_URL: ${{ secrets.DATABASE_URL }} | |