Load PurpleAir data #36
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: '*/10 * * * *' | |
jobs: | |
scheduled: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v3 | |
- name: Setup node.js | |
uses: actions/setup-node@v3 | |
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/index.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 |