Skip to content

statistics-schedule #852

statistics-schedule

statistics-schedule #852

name: statistics-schedule
on:
schedule:
- cron: "0 16 * * *"
env:
COS_SECRET_ID: ${{ secrets.COS_SECRET_ID }}
COS_SECRET_KEY: ${{ secrets.COS_SECRET_KEY }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytz cos-python-sdk-v5
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run Python scripts
run: |
python ./update.py
- name: Push back to repository
run: |
export TZ='Asia/Shanghai'
git config --global user.email "[email protected]"
git config --global user.name "bot"
git add .
git commit -m "Statistics of $(date -d "1 day ago" +"%Y-%m-%d")"
git push --force