Auto update #876
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
| # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
| name: Auto update | |
| on: | |
| push: | |
| branches: [ main ] | |
| schedule: | |
| - cron: '5 3 * * *' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # 允许推送代码 | |
| packages: read # 允许读取包 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python 3.9 | |
| uses: actions/setup-python@v3 | |
| with: | |
| python-version: 3.9 | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install requests | |
| if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
| - name: Auto Update | |
| run: | | |
| echo "auto update start" >> ranking.log | |
| > ranking.log | |
| sh auto_run.sh ${{ secrets.GITHUB_TOKEN }} >> ranking.log | |
| echo "auto update end" >> ranking.log | |
| - name: Commit | |
| run: | | |
| echo "commit&push start" >> ranking.log | |
| git config --global user.email uxiaopeng@gmail.com | |
| git config --global user.name yuxiaopeng | |
| git add . | |
| git commit -m"action:`date`" | |
| git push | |
| echo "commit&push end" >> ranking.log |