-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (51 loc) · 1.76 KB
/
fetch_travel_time_data.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
name: Fetch Travel Times & Weather Data
on:
workflow_dispatch:
schedule:
- cron: '0 * * * *' # every hour
jobs:
fetch_raw_mbajk_data:
runs-on: ubuntu-latest
outputs:
sha_new: ${{ steps.sha_new.outputs.SHA_NEW }}
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: python -m pip install selenium requests pandas dvc[s3]
- name: Authenticate dvc remote
run: |
dvc remote modify origin --local access_key_id "${{ secrets.DVC_ACCESS_KEY_ID }}"
dvc remote modify origin --local secret_access_key "${{ secrets.DVC_SECRET_ACCESS_KEY }}"
- name: Pull data from dvc
run: dvc pull
- name: Scrape travel times
run: python src/data/scrapers/travel_time_scraper.py
- name: Fetch weather data
run: python src/data/weather/fetch_weather_data.py
- name: Push data to dvc
run: |
dvc add data
dvc push
- name: Commit to git
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
git add data.dvc
git commit -m "Update raw mbajk data on `date` with Github Actions"
- name: Push to git
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
- name: Get commit SHA and store it in GITHUB_OUTPUT
id: sha_new
run: echo "SHA_NEW=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"