Generate Latest Data #5
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: Generate Latest Data | |
on: | |
schedule: | |
# Runs at 8 AM UTC every day | |
- cron: '0 8 * * *' | |
workflow_dispatch: | |
jobs: | |
execute-script: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Use Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '20' | |
- name: Install dependencies | |
run: yarn install | |
- name: Get data and update file | |
run: | | |
OUTPUT="$(yarn dlx tsx ./utils/GenerateLatestData.ts)" | |
echo "$OUTPUT" > ./website/public/data/latest.json | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add ./website/public/data/latest.json | |
git commit -m "Update latest data" | |
git push |