-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (33 loc) · 1.09 KB
/
cron.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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