Skip to content

.github/workflows/scheduled-github-analysis.yml #24

.github/workflows/scheduled-github-analysis.yml

.github/workflows/scheduled-github-analysis.yml #24

name: Scheduled GitHub Analysis
on:
schedule:
# 每天 UTC 时间 00:00 运行
- cron: '0 0 * * *'
workflow_dispatch: # 允许手动触发
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9' # 根据需要调整 Python 版本
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install google-cloud-bigquery requests pandas tqdm db-dtypes python-dotenv
- name: Authenticate to GCP
id: 'auth'
uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'
- name: Create results directory
run: mkdir -p result
- name: Run BigQuery and GitHub Analysis
run: |
python main.py
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Copy results to web public folder
run: |
mkdir -p web/public/results
cp result/*.csv web/public/results/
- name: List results in web public folder
run: ls -l web/public/results
- name: Deploy to Vercel
uses: amondnet/vercel-action@v25 # 使用 Vercel Action
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }} # Vercel Token
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} # Vercel Organization ID
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} # Vercel Project ID
working-directory: ./web # 指定 Vercel 项目路径