-
-
Notifications
You must be signed in to change notification settings - Fork 415
40 lines (38 loc) · 1.18 KB
/
update_spider_status.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Update spider status on production
on:
workflow_dispatch:
inputs:
spider_name:
description: 'Spider name'
required: true
status:
type: choice
description: 'New Spider status in production'
options:
- enabled
- disabled
required: true
jobs:
update-status:
runs-on: ubuntu-latest
env:
QUERIDODIARIO_DATABASE_URL: ${{ secrets.QUERIDODIARIO_DATABASE_URL }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Prepare environment
run: |
python -m pip install --upgrade pip
pip install click python-decouple scrapinghub SQLAlchemy psycopg2
- name: Enable spider in production
if: ${{ github.event.inputs.status == 'enabled' }}
run: |
cd data_collection/
python scheduler.py enable-spider --spider_name=${{ github.event.inputs.spider_name }}
- name: Disable spider in production
if: ${{ github.event.inputs.status == 'disabled' }}
run: |
cd data_collection/
python scheduler.py disable-spider --spider_name=${{ github.event.inputs.spider_name }}