Crawl Data #1003
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: Crawl Data | |
| on: | |
| schedule: | |
| - cron: "0 2 * * *" | |
| workflow_dispatch: | |
| push: { branches: ["master", "main"] } | |
| jobs: | |
| crawl: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v2 | |
| - name: Install Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: 3.8 | |
| - name: Install dependencies | |
| run: pip install requests | |
| - name: Crawl data and update JSON | |
| run: | | |
| python CrawlData/crawl_data.py | |
| env: | |
| DATA_JSON_PATH: CrawlData/data.json | |
| - name: commit | |
| run: | | |
| git config --global user.email 3504852205@qq.com | |
| git config --global user.name pwxiao | |
| git add . | |
| git commit -m "update" -a | |
| - name: Push changes | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} |