Fetch Bing Image #2294
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: 'Fetch Bing Image' | |
| on: | |
| push: | |
| branches: | |
| - master | |
| paths: | |
| - 'json/**' | |
| - 'images/**' | |
| schedule: | |
| - cron: '0 17 * * *' | |
| watch: | |
| types: [started] | |
| env: | |
| TZ: Asia/Shanghai | |
| jobs: | |
| Bing-Spider: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - name: 'Set up Python' | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: 3.8 | |
| - name: 'Install dependencies' | |
| run: python -m pip install --upgrade pip | |
| - name: 'Install requirements' | |
| run: pip install -r ./requirements.txt | |
| - name: 'Working' | |
| timeout-minutes: 350 | |
| run: | | |
| echo `date +"%Y-%m-%d %H:%M:%S"` > time.log | |
| python spider.py | |
| - name: Commit files | |
| run: | | |
| git config --local user.email "i@ningkai.wang" | |
| git config --local user.name "WangNingkai" | |
| git add -A | |
| git commit -m ":rocket: Fetch BingImage at $(date +'%Y-%m-%d %H:%M')" -a | |
| - name: 'Push changes' | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| force: true |