-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (47 loc) · 1.63 KB
/
full-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
39
40
41
42
43
44
45
46
47
48
49
name: Run full scrape
on:
workflow_dispatch:
jobs:
scrape:
runs-on: ubuntu-latest
environment: MTFP projects
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"
- name: Install Python libraries
run: pip install -r requirements.txt
- name: Scrape all bills
run: python3 scrape-full.py
- name: Add and commit
uses: EndBug/add-and-commit@v9
with:
committer_name: "Automated"
committer_email: "[email protected]"
message: "Latest data"
- name: Push
run: git push
- name: Trigger frontend redeploy
if: success()
run: |
curl -X POST \
-H "Authorization: Bearer ${{secrets.GH_ACCESS_TOKEN}}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/eidietrich/capitol-tracker-23/actions/workflows/main.yml/dispatches \
-d '{"ref": "main"}'
- name: Slack Notification on cached scrape SUCCESS
if: success()
uses: tokorom/action-slack-incoming-webhook@main
env:
INCOMING_WEBHOOK_URL: ${{ secrets.SLACK_ERIC_TEST_NOTIFICATIONS_WEBHOOK_URL }}
with:
text: "Deep data scrape from LAWS was successful"
- name: Slack Notification on FAIL
if: failure()
uses: tokorom/action-slack-incoming-webhook@main
env:
INCOMING_WEBHOOK_URL: ${{ secrets.SLACK_ERIC_TEST_NOTIFICATIONS_WEBHOOK_URL }}
with:
text: "ERROR - something broke with data scrape from LAWS"