Scrape latest data #132031
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 data | |
on: | |
push: | |
workflow_dispatch: | |
schedule: | |
- cron: '*/5 * * * *' # If you enter a time here, note that it will be in UTC | |
jobs: | |
scrape: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Prepare the environment | |
- name: Check out this repo | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
# Step 2: Get the latest data and store it as a CSV | |
- name: Fetch latest data | |
run: |- | |
curl "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_day.csv" -o usgs_current.csv | |
# Step 3: Commit and push | |
- name: Commit and push | |
run: |- | |
git config user.name "Automated" | |
git config user.email "actions@users.noreply.github.com" | |
git add -A | |
timestamp=$(date -u) | |
git commit -m "Latest data: ${timestamp}" || exit 0 | |
git push |