Scrape latest data #12882
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: Scrape latest data | |
on: | |
push: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 6-18 * * *" # “At minute 0 past every hour from 6 through 18.” | |
jobs: | |
scheduled: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: "16" | |
cache: "npm" | |
- name: Fetch latest data | |
run: npm ci && npm run fetch | |
- name: Commit and push if it changed | |
run: |- | |
git config user.name "Automated" | |
git config user.email "[email protected]" | |
git add -A | |
timestamp=$(date -u) | |
git commit -m "Latest data: ${timestamp}" || exit 0 | |
git push |