-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (50 loc) · 1.44 KB
/
scrape.yml
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Run Scrapy Spiders
on:
push:
branches: [master]
pull_request:
branches: [master]
schedule:
- cron: "0 0 * * *" # Run daily at midnight UTC
jobs:
scrape:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt scrapy
playwright install
- name: Run scraping script
run: ./scrape.sh
- name: Move CSV files to public directory
run: |
mkdir -p public
mv output/*.csv public/
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.MEONG }}
commit-message: Update scraped data
title: Update scraped data
body: |
This PR updates the scraped data.
- Auto-generated by [create-pull-request][1]
[1]: https://github.com/peter-evans/create-pull-request
branch: update-scraped-data
base: master
delete-branch: true
- name: Upload CSV files as artifact
uses: actions/upload-artifact@v3
with:
name: scraped-data
path: public/*.csv