-
Notifications
You must be signed in to change notification settings - Fork 470
54 lines (48 loc) · 1.41 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Scout Scrape
on:
schedule:
- cron: "0 10 * * *"
workflow_dispatch:
jobs:
scout:
runs-on: ubuntu-latest
steps:
# checkouts
- uses: actions/checkout@v3
- name: checkout results repo
uses: actions/checkout@v3
with:
repository: openstates/scraper-artifacts
path: artifacts
token: ${{ secrets.GH_ACCESS_TOKEN }}
# install python environment
- name: setup Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: install Poetry
uses: snok/[email protected]
- name: cache Poetry virtualenv
uses: actions/cache@v2
id: poetry-cache
with:
path: ~/.virtualenvs/
key: poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
poetry-${{ hashFiles('**/poetry.lock') }}
- name: set poetry config path
run: poetry config virtualenvs.path ~/.virtualenvs
- name: install python dependencies
run: poetry install --no-root
# scout runs
- name: run instrumented scout for people
run: poetry run scripts/instrumented_scout.py
- name: update remote git repo if necessary
run: |-
cd artifacts
git diff
git config --global user.email "[email protected]"
git config --global user.name "openstates-bot"
git add -A
git commit -m "scout run" || exit 0
git push