Scrape latest food banks #56729
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: Scrape latest food banks | |
on: | |
push: | |
workflow_dispatch: | |
schedule: | |
- cron: '7,37 * * * *' | |
jobs: | |
scheduled: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Check out this repo | |
uses: actions/checkout@v2 | |
- name: Fetch latest CSV data | |
run: |- | |
curl https://www.givefood.org.uk/api/1/foodbanks/?format=csv > foodbanks.csv | |
- name: Fetch latest YAML data | |
run: |- | |
curl https://www.givefood.org.uk/api/2/foodbanks/?format=yaml > foodbanks.yaml | |
- name: Fetch latest XML data | |
run: |- | |
curl https://www.givefood.org.uk/api/2/foodbanks/?format=xml > foodbanks.xml | |
- name: Fetch latest GeoJSON data | |
run: |- | |
curl https://www.givefood.org.uk/api/2/foodbanks/?format=geojson > foodbanks.geojson | |
- name: Commit and push if it changed | |
run: |- | |
git config user.name "Automated" | |
git config user.email "[email protected]" | |
git add -A | |
timestamp=$(date -u) | |
git commit -m "Latest food banks data: ${timestamp}" || exit 0 | |
git push |