Load PurpleAir data #554
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: Load PurpleAir data | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
scheduled: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v4 | |
- name: Setup node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "lts/hydrogen" | |
- name: Install modules | |
run: npm install | |
- name: Load PurpleAir data | |
env: | |
PURPLEAIR_API_KEY: ${{secrets.PURPLEAIR_API_KEY}} | |
run: node scripts/load.js | |
- name: Index data | |
run: node scripts/index.js | |
- name: Analyze data | |
run: node scripts/analyze.js | |
- name: Commit results | |
run: |- | |
git config user.name "Automated" | |
git config user.email "[email protected]" | |
git add -A | |
timestamp=$(date -Is) | |
git commit -m "PurpleAir Data: ${timestamp}" || exit 0 | |
git push |