feat: Phase 1 添加 GHA 定时、run-daily.sh 与 Docker 部署
让早报可在无本地服务器环境下定时生成并推送企微,补齐 Linux/CI 入口。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
64
.github/workflows/daily.yml
vendored
Normal file
64
.github/workflows/daily.yml
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
name: daily
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# 08:30 CST (UTC+8) = 00:30 UTC
|
||||
- cron: "30 0 * * *"
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
skip_push:
|
||||
description: Skip WeCom push (generate only)
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
concurrency:
|
||||
group: daily-report
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
report:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
env:
|
||||
TZ: Asia/Shanghai
|
||||
WECOM_WEBHOOK_KEY: ${{ secrets.WECOM_WEBHOOK_KEY }}
|
||||
GITHUB_TOKEN: ${{ secrets.GH_PAT || github.token }}
|
||||
CURSOR_API_KEY: ${{ secrets.CURSOR_API_KEY }}
|
||||
DAILY_LLM_API_KEY: ${{ secrets.DAILY_LLM_API_KEY }}
|
||||
DAILY_LLM_API_BASE: ${{ vars.DAILY_LLM_API_BASE }}
|
||||
DAILY_LLM_MODEL: ${{ vars.DAILY_LLM_MODEL }}
|
||||
DAILY_REPORT_MODE: ${{ vars.DAILY_REPORT_MODE }}
|
||||
CURSOR_MODEL: ${{ vars.CURSOR_MODEL }}
|
||||
DAILY_AI_NEWS: ${{ vars.DAILY_AI_NEWS }}
|
||||
DAILY_CN_AI_NEWS: ${{ vars.DAILY_CN_AI_NEWS }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
cache: pip
|
||||
|
||||
- name: Install dependencies
|
||||
run: pip install -r requirements.txt
|
||||
|
||||
- name: Generate and push daily report
|
||||
run: |
|
||||
ARGS=()
|
||||
if [ "${{ inputs.skip_push }}" = "true" ]; then
|
||||
ARGS+=(--skip-push)
|
||||
fi
|
||||
chmod +x ./run-daily.sh
|
||||
./run-daily.sh --force "${ARGS[@]}"
|
||||
|
||||
- name: Upload report artifacts
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: daily-report-${{ github.run_id }}
|
||||
path: |
|
||||
output/*.md
|
||||
output/*.json
|
||||
if-no-files-found: ignore
|
||||
retention-days: 14
|
||||
Reference in New Issue
Block a user