-
Notifications
You must be signed in to change notification settings - Fork 23
61 lines (53 loc) · 1.91 KB
/
github-events.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
name: Run GitHub Events Daily
on:
workflow_dispatch:
schedule:
- cron: "* 0/12 * * *" #'*/60 * * * *'
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
env:
TIME_ZONE: "Asia/Shanghai"
RUN_ENV: "production" # within ['production', 'development']
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
steps:
# ============================================
# TODO [√] 检查工作分支及 Workflows 运行环境
# ============================================
- name: Checkout
uses: actions/checkout@v2
# ============================================
# TODO [√] 创建 Python3.6+ 编译环境
# ============================================
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
# ============================================
# TODO [√] 安装 Project 第三方依赖
# ============================================
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# ============================================
# TODO [√] 测试 Scaffold 脚手架指令
# ============================================
- name: Run github events
run: |
cd src && python main.py run
# ============================================
# TODO [√] 更新仓库数据
# ============================================
- name: Setup GIT user
uses: fregante/setup-git-user@v1
- name: Push done work
run: |
git add -A
if ! git diff-index --quiet HEAD; then
git commit -m "Automated deployment @ $(date '+%Y-%m-%d %H:%M:%S') ${{ env.TIME_ZONE }}"
git push --force origin main
fi