mirror of
https://github.com/idealzhou1/bing-auto-rewards.git
synced 2025-12-17 15:24:34 +08:00
Create daily-checkin.yml
This commit is contained in:
57
.github/workflows/daily-checkin.yml
vendored
Normal file
57
.github/workflows/daily-checkin.yml
vendored
Normal 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
|
||||||
Reference in New Issue
Block a user