Crawl #1378
This file contains 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
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Crawl | |
on: | |
workflow_dispatch: | |
schedule: | |
# At every 20th minute from 0 through 59 past every hour from 8 through 10 | |
# on every day-of-week from Sunday through Saturday. | |
# 0-59/20 0-2 * * 0-6 | |
- cron: "30 0-2 * * 0-6" | |
jobs: | |
crawl: | |
runs-on: ubuntu-latest | |
# choose an environment | |
environment: crawl | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Crawl news | |
run: | | |
python -m app.spider.pbs_article | |
env: | |
TIME_ZONE: ${{ secrets.TIME_ZONE }} | |
# mysql | |
HOST: ${{ secrets.HOST }} | |
PORT: ${{ secrets.PORT }} | |
DB_NAME: ${{ secrets.DB_NAME }} | |
USER_NAME: ${{ secrets.USER_NAME }} | |
PASSWORD: ${{ secrets.PASSWORD }} | |
# qiniu | |
QINIU_ACCESS_KEY: ${{ secrets.QINIU_ACCESS_KEY }} | |
QINIU_SECRET_KEY: ${{ secrets.QINIU_SECRET_KEY }} | |
QINIU_BUCKET_NAME: ${{ secrets.QINIU_BUCKET_NAME }} | |
# dingding | |
DINGDING_PUSH: ${{ secrets.DINGDING_PUSH }} | |
DINGDING_TOKEN: ${{ secrets.DINGDING_TOKEN }} | |
DINGDING_ROBOT_KEY: ${{ secrets.DINGDING_ROBOT_KEY }} | |
# weixin (no fixed ip) | |
# WX_APPID: ${{ secrets.WX_APPID }} | |
# WX_SECRET: ${{ secrets.WX_SECRET }} | |
# WX_SALT: ${{ secrets.WX_SALT }} | |
# website | |
WEB_APP_URL: ${{ secrets.WEB_APP_URL }} | |
FILE_SERVER_URL: ${{ secrets.FILE_SERVER_URL }} | |
# ghost | |
GHOST_KEY: ${{ secrets.GHOST_KEY }} | |
GHOST_URL: ${{ secrets.GHOST_URL }} |