-
-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (36 loc) · 1.25 KB
/
scrape.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
31
32
33
34
35
36
37
38
name: Scrape latest data
on:
push:
workflow_dispatch:
schedule:
- cron: '21 3 * * *'
jobs:
scheduled:
runs-on: ubuntu-latest
steps:
- name: Check out this repo
uses: actions/checkout@v2
- name: Setup Python with pip cache
uses: actions/setup-python@v2
with:
python-version: '3.10'
cache: 'pip'
- name: Install dependencies
run: |-
pip install -r requirements.txt
- name: Fetch latest data
run: |-
curl https://wildlife.ca.gov/Fishing/Ocean/Regulations/Sport-Fishing/Invertebrate-Fishing-Regs \
| strip-hidden-form-values > Invertebrate-Fishing-Regs.html
curl https://wildlife.ca.gov/Fishing/Ocean/Regulations/Sport-Fishing/Marine-Plants \
| strip-hidden-form-values > Marine-Plants.html
curl https://wildlife.ca.gov/Fishing/Ocean/Regulations/Sport-Fishing/General-Ocean-Fishing-Regs \
| strip-hidden-form-values > General-Ocean-Fishing-Regs.html
- name: Commit and push if it changed
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