Create daily-checkin.yml

This commit is contained in:
idealzhou1
2025-08-25 11:49:41 +08:00
committed by GitHub
parent aea30a6492
commit e83b1c93d3

57
.github/workflows/daily-checkin.yml vendored Normal file
View File

@@ -0,0 +1,57 @@
name: Bing Daily Check-in
on:
schedule:
# 每天凌晨2点执行UTC时间对应北京时间10点
- cron: '0 2 * * *'
workflow_dispatch: # 允许手动触发
push:
branches: [ main ]
jobs:
bing-checkin:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install Chrome
run: |
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google-chrome.list
sudo apt-get update
sudo apt-get install -y google-chrome-stable
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r src/requirements.txt
- name: Create config directory
run: mkdir -p config
- name: Setup accounts configuration
run: |
# 从GitHub Secrets读取账号配置
echo '${{ secrets.ACCOUNTS_CONFIG }}' > config/accounts.json
- name: Run Bing automation
run: |
cd src
python bingZDH.py --once
- name: Upload logs
uses: actions/upload-artifact@v3
if: always()
with:
name: bing-logs
path: |
src/*.log
src/*.png
retention-days: 7