-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (41 loc) · 1.22 KB
/
update-schedule.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: Update schedule data from NGTV v1 API
on:
push:
branches:
- source
schedule:
- cron: '*/5 * * * *'
jobs:
fetch:
runs-on: ubuntu-latest
steps:
- name: Pull Python code
uses: actions/checkout@v2
with:
ref: source
- name: Pull existing schedule data
uses: actions/checkout@v2
with:
ref: ngtv-v1
path: ngtv-v1
- name: Install Python dependencies
run: |
pip3 install requests
pip3 install datetime
pip3 install pytz
- name: Fetch latest schedule data
run: python3 build.py
- name: Detect changes
id: detect_changes
working-directory: ngtv-v1
run: if [ -n "$(git status --porcelain)" ]; then echo "::set-output name=changes_detected::yes"; fi
- name: Push changes back to repository
if: steps.detect_changes.outputs.changes_detected == 'yes'
working-directory: ngtv-v1
run: |
git config user.name 'Turner Schedule API'
git config user.email '[email protected]'
git config push.default simple
git add -A
git commit -m 'Database update'
git push