forked from hl128k/tvbox
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (49 loc) · 1.6 KB
/
python-app.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: Python application
on:
push:
schedule:
- cron: '0 21 */5 * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 检查分支
uses: actions/checkout@v4
- name: 安装 Python 3.10
uses: actions/setup-python@v4
with:
python-version: 3.10.*
- name: 安装模块
run: |
pip install requests
pip install urllib3
pip install pycryptodome
- name: 生成json文件
run: |
export TZ='Asia/Shanghai'
python autoUrl.py
- name: 暂存提交
run: |
git config --global user.name 'imruxin'
git config --global user.email '[email protected]'
export TZ='Asia/Shanghai'
git add .
git commit -m "update" -a
- name: 更新仓库内容
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: 安装 SSH key
run: |
mkdir -p ~/.ssh/
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H -p ${{ secrets.SSH_PORT }} ${{ secrets.SERVER_HOST }} >> ~/.ssh/known_hosts
- name: 配置 SSH
run: |
echo "Host ${{ secrets.SERVER_HOST }}" >> ~/.ssh/config
echo " Port ${{ secrets.SSH_PORT }}" >> ~/.ssh/config
echo " User ${{ secrets.SERVER_USER }}" >> ~/.ssh/config
- name: 同步 TV 文件夹到服务器
run: |
rsync -avz --delete ./tv/ ${{ secrets.SERVER_HOST }}:${{ secrets.REMOTE_PATH }}