Daily Python Script Execution #2930
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: Daily Python Script Execution | |
on: | |
schedule: | |
- cron: '*/10 * * * *' | |
workflow_dispatch: # 允许手动触发 | |
jobs: | |
run-python-script: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' # 更新到更新的Python版本 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Run Python script | |
env: | |
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }} | |
CF_ZONE_ID: ${{ secrets.CF_ZONE_ID }} | |
CF_DNS_NAME: ${{ secrets.CF_DNS_NAME }} | |
PUSHPLUS_TOKEN: ${{ secrets.PUSHPLUS_TOKEN }} | |
run: python cfdns.py |