Download & process urban water data #108
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: Download & process urban water data | |
on: | |
schedule: | |
- cron: 35 7 * * * # every day around 7:35 p.m. Pacific | |
workflow_dispatch: | |
jobs: | |
get: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: '3.9' | |
cache: 'pipenv' | |
- name: Install pipenv | |
run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python | |
- name: Install dependencies | |
run: pipenv install | |
# - name: Ping | |
# run: pipenv run python urban-water-use/ping.py | |
# - name: Check file | |
# id: check_file | |
# run: | | |
# if [ -n "$(git status --porcelain urban-water-use/data/ping.json)" ]; then | |
# echo "Update date has changed"; | |
# echo "::set-output name=file_change::true" | |
# # break | |
# else | |
# echo "No change" | |
# echo "::set-output name=file_change::false" | |
# fi | |
# - uses: EndBug/add-and-commit@v8 | |
# with: | |
# message: 'New data added' | |
# add: '*.json' | |
- name: Run scraper | |
# if: steps.check_file.outputs.file_change == 'true' | |
run: pipenv run python urban-water-use/scrape.py | |
- name: Process data | |
# if: steps.check_file.outputs.file_change == 'true' | |
run: pipenv run jupyter execute urban-water-use/r-gpcd.ipynb | |
- name: Add and commit | |
# if: steps.check_file.outputs.file_change == 'true' | |
uses: EndBug/add-and-commit@v8 | |
with: | |
message: 'New files data added' |