Fetch data and save as csv to github #33
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: Fetch data and save as csv to github | |
on: | |
workflow_dispatch: | |
schedule: # if scheduled on the hour, job might be skipped due to runner high workload | |
- cron: '10-59/5 13-15 * * 1-5' # Run every 5 minutes from 08:00 to 10:00, minutes 10 to 59, Eastern Time on weekdays (Monday to Friday) | |
- cron: '10-59/5 22-23,0 * * 1-5' # Run every 5 minutes from 17:00 to 19:00, minutes 10 to 59, Eastern Time on weekdays (Monday to Friday) | |
jobs: | |
run-script: | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18' | |
- name: Install dependencies | |
run: npm install | |
- name: Run Node.js script | |
run: | | |
node query_nodb.js | |
git config user.name github-actions | |
git config user.email [email protected] | |
git add . | |
git commit -m "cron generated data" | |
git push | |