-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (38 loc) · 1.12 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
name: Scrape
on:
schedule:
- cron: "0 23 * * *"
workflow_dispatch:
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
jobs:
scrape-latest:
runs-on: windows-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install requirements
run: pip install -r requirements.txt
- name: Run Scraper
run: python daily_scraper.py
- name: Set env vars
run: |
$DATE = (python -c "import datetime as dt; print(dt.datetime.now().date())")
$env:GITHUB_ENV = "DATE=$DATE"
- name: Send mail
uses: dawidd6/action-send-mail@v3
with:
server_address: smtp.gmail.com
server_port: 465
username: ${{secrets.MAIL_USERNAME}}
password: ${{secrets.MAIL_PASSWORD}}
subject: Daily Osaka Hotel Scrape ${{env.DATE}}
to: ${{secrets.MAIL_USERNAME}}
from: Automated Email
ignore_cert: true
secure: true
attachments: osaka_daily_hotel_data.csv