Python CI 2 #16
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: Python CI 2 | |
on: | |
# 每天0点1分触发(UTC时间) | |
schedule: | |
- cron: '1 0 * * *' | |
# 允许手动触发工作流 | |
workflow_dispatch: | |
# 提交代码到指定分支时触发 | |
push: | |
branches: | |
- main # 只在主分支提交时触发 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
BOT_TOKEN: ${{ secrets.BOT_TOKEN }} | |
CHAT_ID: ${{ secrets.CHAT_ID }} # 这里设置可以用于多个账户 | |
USER1: ${{ secrets.USER1 }} # 用户1 | |
PASS1: ${{ secrets.PASS1 }} # 密码1 | |
USER2: ${{ secrets.USER2 }} # 用户2 | |
PASS2: ${{ secrets.PASS2 }} # 密码2 | |
# 可以继续扩展更多用户和密码 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.9' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt # 假设你的项目有 requirements.txt | |
- name: Run Python script | |
run: python 69yun.py # 执行你的 Python 脚本 |