更新数据集 #76
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 更新数据集 | |
on: | |
schedule: | |
- cron: '0 0 * * 0' # 每周日 0点运行 | |
workflow_dispatch: | |
jobs: | |
run-main: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: 设置 Python 环境 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: 安装依赖 | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: 运行 main.py | |
env: | |
MYSQL_HOST: ${{ secrets.MYSQL_HOST }} | |
MYSQL_PORT: ${{ secrets.MYSQL_PORT }} | |
MYSQL_USER: ${{ secrets.MYSQL_USER }} | |
MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }} | |
MYSQL_CHARSET: ${{ secrets.MYSQL_CHARSET }} | |
MYSQL_DATABASE: ${{ secrets.MYSQL_DATABASE }} | |
MONGO_URI: ${{ secrets.MONGO_URI }} | |
PROXY: ${{ secrets.PROXY }} | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
run: | | |
python main.py | |
- name: 自动发布 Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: dataset-$(date +'%Y/%m/%d') | |
name: dataset更新-$(date +'%Y/%m/%d') | |
body: | | |
本次数据集已自动更新,触发自 GitHub Actions。 |