Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
xielk authored Sep 22, 2024
1 parent 1614e9e commit a732593
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,40 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Send Cloudflare Analytics Notification

on:
workflow_dispatch: # 手动触发
schedule:
# 设置启动时间,为 UTC 时间, UTC23点 对应北京时间早7点
- cron : '00 23 * * *'
workflow_dispatch:

permissions:
contents: read

jobs:
send-notification:
runs-on: ubuntu-latest
build:

runs-on: ubuntu-latest
env:
TZ: Asia/Shanghai
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
- uses: actions/checkout@v3
- name: Set up Python 3.12
uses: actions/setup-python@v3
with:
python-version: '3.8' # 你可以根据需要修改 Python 版本

python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- name: Run script
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run weather Report
run: |
python report_cdn.py
env:
CF_API_KEY: ${{ secrets.CF_API_KEY }}
ZONE_ID: ${{ secrets.ZONE_ID }}
APP_ID: ${{ secrets.APP_ID }}
APP_SECRET: ${{ secrets.APP_SECRET }}
OPEN_ID: ${{ secrets.OPEN_ID }}
TEMPLATE_ID: ${{ secrets.TEMPLATE_ID }}
run: python report_cdn.py # 替换为你的 Python 脚本名

0 comments on commit a732593

Please sign in to comment.