feat: Add deployment workflow and stats processing script for player statistics

This commit is contained in:
zhangyuheng
2026-03-10 10:12:49 +08:00
parent 67ec4420f2
commit b97cde5516
2 changed files with 279 additions and 0 deletions

55
.github/workflows/deploy.yml vendored Normal file
View File

@@ -0,0 +1,55 @@
name: Deploy to GitHub Pages
on:
push:
branches: [main]
schedule:
# Every 2 days at 04:00 UTC
- cron: "0 4 */2 * *"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install Python dependencies
run: pip install requests tqdm
- name: Run statsprocess.py
env:
STATS_USER: ${{ secrets.STATS_USER }}
STATS_PASS: ${{ secrets.STATS_PASS }}
run: python statsprocess.py
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: .
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4