-
Notifications
You must be signed in to change notification settings - Fork 35
58 lines (53 loc) · 1.59 KB
/
main5.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
name: get_vmess
# 触发条件
on:
workflow_dispatch:
schedule:
- cron: '30 */4 * * *'
env: # 设置环境变量
TZ: Asia/Shanghai
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: 迁出代码
uses: actions/checkout@v2
- name: 安装Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: 加载缓存
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/run_in_Actions/requirements2.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: 设置时区
run: sudo timedatectl set-timezone 'Asia/Shanghai'
- name: 安装依赖
run: |
pip install -r ./utils/requirements2.txt
- name: 执行任务
env:
vemss_key: ${{secrets.vemss_key}}
vmess_api: ${{secrets.vmess_api}}
vmess_api2: ${{secrets.vmess_api2}}
vemss_id: ${{secrets.vemss_id}}
vmess_code: ${{secrets.vmess_code}}
recomm_code: ${{secrets.recomm_code}}
vmess_token: ${{secrets.vmess_token}}
vmess_name: ${{secrets.vmess_name}}
bot_token: ${{secrets.bot_token}}
chat_id: ${{secrets.chat_id}}
run: |
python ./utils/get_vmess.py
- name: Commit
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
git add ./links
git commit -m "vmess节点更新时间 $(date '+%Y-%m-%d %H:%M:%S')"
git config pull.rebase false
git pull origin master
git push origin master