Skip to content

Update python-app.yml #4

Update python-app.yml

Update python-app.yml #4

Workflow file for this run

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 }}