Fetch daily UK small boat data #819
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: Fetch daily UK small boat data | |
on: | |
repository_dispatch: | |
schedule: | |
- cron: '0 12 * * *' | |
jobs: | |
scheduled: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get current date | |
id: date | |
run: echo "::set-output name=date::$(date +'%Y-%m-%d')" | |
- name: Check out this repo | |
uses: actions/checkout@v4 | |
- name: Fetch the data | |
run: |- | |
curl -s --compressed -o data/daily_small_boats/${{ steps.date.outputs.date }}.html "https://www.gov.uk/government/statistical-data-sets/migrants-detected-crossing-the-english-channel-in-small-boats" | |
- name: Commit and push data 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 daily UK small boat data: ${timestamp}" || exit 0 | |
git push |