-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (35 loc) · 1.38 KB
/
sync-ev-charging.yml
File metadata and controls
37 lines (35 loc) · 1.38 KB
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
36
37
name: Sync EV Charging Data
on:
schedule:
- cron: '0 10 * * 1' # Monday 10am UTC (AFDC updates frequently)
workflow_dispatch: {} # Manual trigger
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- name: Sync EV charging stations from AFDC API
run: npx tsx scripts/sync-ev-charging.ts
env:
# Add NREL_API_KEY as a GitHub secret for production use.
# Falls back to DEMO_KEY if not set (rate-limited but functional).
NREL_API_KEY: ${{ secrets.NREL_API_KEY }}
- name: Install tippecanoe
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq libsqlite3-dev zlib1g-dev
git clone --depth 1 https://github.com/felt/tippecanoe.git /tmp/tippecanoe
cd /tmp/tippecanoe && make -j$(nproc) && sudo make install
- name: Rebuild tiles
run: bash scripts/build-tiles.sh
- name: Commit & push if changed
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add data/ev-charging.json public/tiles/ev-charging.pmtiles
git diff --staged --quiet || (git commit -m "data: update EV charging stations (AFDC weekly)" && git push)