-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (28 loc) · 862 Bytes
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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