Run Your Python Script #74
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run Your Python Script | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '6 10 * * *' # 在UTC时间上午10点6分运行 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' # 选择所需的 Python 版本 | |
- name: Install dependencies | |
run: pip install -r requirements.txt # 根据你的需求修改 requirements.txt 文件路径 | |
- name: Run Python script | |
env: | |
TELEGRAM_API_TOKEN: ${{ secrets.TELEGRAM_API_TOKEN }} | |
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} | |
ACCOUNTS_AND_PASSWORDS: ${{ secrets.ACCOUNTS_AND_PASSWORDS }} | |
run: python py.py # 根据你的脚本文件名修改这里 |