-
Notifications
You must be signed in to change notification settings - Fork 14
46 lines (40 loc) · 1.11 KB
/
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
name: schedule
on:
schedule:
# 每小时整点执行
- cron: "0 * * * *"
jobs:
build:
runs-on: ubuntu-latest
env:
TZ: Asia/Shanghai
steps:
# 克隆仓库
- name: Clone repo
uses: actions/checkout@v2
# 配置python环境
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
# 安装python依赖
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# 配置git
- name: Config git
run: |
git config --local user.email "[email protected]"
git config --local user.name "github"
git remote set-url origin "https://${{ github.actor }}:${{ github.token }}@github.com/${{ github.repository }}"
git pull --rebase
# 运行
- name: Run python
run: python main.py
# 更新仓库
- name: Update repo
run: |
git add .
git commit -m "auto update"
git push -u origin main