-
Notifications
You must be signed in to change notification settings - Fork 36
68 lines (59 loc) · 1.96 KB
/
auto-epg.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
name: auto update
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
# auto update at 1,7,12,18 o'clock Beijing time
# check at https://crontab.guru/
- cron: "0 17,23,4,10 * * *"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- uses: actions/cache@v1
if: startsWith(runner.os, 'Linux')
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Set Timezone
run: sudo timedatectl set-timezone 'Asia/Shanghai'
- name: Update tv-guide
run: |
pwd
python get-epg.py
- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "github-actions[bot]"
git add -A
git diff-index --quiet HEAD || git commit -m "🚀 update tv-guide at $(date '+%Y-%m-%d %H:%M:%S')"
- name: Pull changes
run: git pull -r
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# - name: Git Commit and Push
# run: |
# git config core.ignorecase false
# git config --local user.email "[email protected]"
# git config --local user.name "github-actions[bot]"
# git stash
# git pull
# git stash pop
# git add .
# git commit -m "🚀 update tv-guide at $(date '+%Y-%m-%d %H:%M:%S')"
# git push