wildfires-etl #22037
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: wildfires-etl | |
on: | |
# workflow_dispatch | |
schedule: | |
- cron: '11 * * * *' # runs every hour on the 11th minute | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: checkout repo content | |
uses: actions/checkout@v2 # checkout the repository content to github runner | |
- name: setup python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.9.7' # install the python version needed | |
- name: install things | |
run: | | |
python -m pip install --upgrade pip | |
pip install pandas==1.3.2 geopandas==0.9.0 Fiona==1.8.20 mapbox-tilesets mapboxcli | |
git clone https://github.com/golfecholima/tippecanoe.git | |
cd tippecanoe | |
make -j | |
make install | |
- name: execute py script # run etl.py to get the latest data | |
env: | |
TOKEN: ${{ secrets.MAPBOX_TOKEN_CLI }} | |
run: python california-wildfires-map/etl/etl.py | |
- name: commit files | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git pull | |
git add -A | |
git commit -m "update data" -a | |
- name: push changes | |
uses: ad-m/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: main |