-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (57 loc) · 1.81 KB
/
run.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#RR 11/16/23
# this action retrieves a snapshot of Divvy station status info from https://gbfs.lyft.com/gbfs/2.3/chi/en/station_status.json
# the intent is to run this every 15 minutes for a week
name: request Divvy station status at predefined intervals
#Set cron to every hour rather than 15 minutes, because I think I was being throttled
on:
schedule:
- cron: "0 * * * *"
workflow_dispatch:
repository_dispatch:
permissions:
contents: write
jobs:
fetch:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check-out the repo
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
# cache: "pip"
- name: Cache Python dependencies
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Python venv and requirements
run: make venv
- name: Configure git
run: git config --global user.name "Automated"; git config user.email "[email protected]"
#added these debugging steps
- name: check Python packages
run: |
source venv/bin/activate
pip freeze
- name: Check Python version and path
run: |
source venv/bin/activate
python --version
which python
# retrieve divvy station data
- name: request-divvy-status
run: |
source venv/bin/activate
make retrieve-data
git add data/*
git diff --cached --quiet || git commit -m "add new or updated station status info to data directory"
git push
# transform data, maybe add this later or I can do it manually