Data Fetching #44
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: Data Fetching | |
on: | |
push: | |
schedule: | |
- cron: "5 19 * * *" | |
workflow_dispatch: | |
jobs: | |
Fetch-Time-Data: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Setup Python environment | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
architecture: 'x64' | |
cache: 'pip' | |
cache-dependency-path: requirements.txt | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r ./requirements.txt | |
- name: Merging resources | |
env: | |
REQUEST_LIMIT: "6" | |
run: | | |
set -o xtrace | |
python ./data_merging.py | |
python ./district_boundary_transform.py | |
python ./pdd_transform.py | |
- name: Archive merging outputs | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: Data Files | |
retention-days: 14 | |
path: | | |
routeTimeList.min.json | |
- name: Update MD5 | |
run: | | |
md5sum routeTimeList.min.json | cut -f1 -d ' ' | tr -d $'\n' > routeTimeList.md5 | |
- name: create deployment folder | |
run: mkdir -p build | |
- name: cp files into deployment folder | |
run: | | |
cp \ | |
routeTimeList.min.json \ | |
index.html \ | |
main.js \ | |
style.css \ | |
custom_heatmap_leaflet.js \ | |
custom_leaflet_bigimage.js \ | |
kdtree.js \ | |
filesaver.js \ | |
district_boundaries.geojson \ | |
pdd.geojson \ | |
one_bite_logo.png \ | |
CNAME \ | |
jt-share.png \ | |
build/ | |
- name: Update resources | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: build | |
commit-message: Update resources | |
branch: gh-pages | |
clean: false |