刷步数 #296
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: 刷步数 | |
on: | |
schedule: | |
- cron: '49 0 * * *' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
#config-name: [CONFIG, CONFIG1, CONFIG2, CONFIG3, CONFIG4, CONFIG5, CONFIG6, CONFIG7, CONFIG8, CONFIG9] | |
config-name: [CONFIG, CONFIG1, CONFIG2, CONFIG3, CONFIG10] # 假设你有 CONFIG1 和 CONFIG2 这两个 Secrets | |
timeout-minutes: 240 | |
steps: | |
- name: Checkout codes | |
uses: actions/checkout@v3 | |
- name: Update system and install zsh | |
run: | | |
sudo -E apt-get -qq update | |
sudo -E apt-get install zsh -y | |
- name: 初始化Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: 3.8 | |
- name: 开始 | |
env: | |
CONFIG: ${{ secrets[matrix.config-name] }} # 使用矩阵策略动态选择 Secret | |
run: | | |
pip3 install requests pytz | |
echo "$CONFIG" > config.json # 假设您的脚本是修改过的,能从 config.json 读取配置 | |
python3 main.py |