-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (59 loc) · 2.24 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
62
63
name: scrape
on:
schedule:
- cron: '11 * * * *' # Each hour At 11 min Ref https://crontab.guru/examples.html
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
#----------------------------------------------
# check-out repo and set-up python
#----------------------------------------------
- name: Check out repository
uses: actions/checkout@v3
- name: Set up python
uses: actions/setup-python@v3
with:
python-version: 3.8
#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
# Install Poetry 1.8.5
- name: Install Poetry 1.8.5
run: |
curl -sSL https://install.python-poetry.org | python3 - --version 1.8.5
#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
# - name: Load cached venv
# id: cached-poetry-dependencies
# uses: actions/cache@v2
# with:
# path: .venv
# key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root --no-dev
#----------------------------------------------
# run scrape
#----------------------------------------------
- name: Scrape
env:
TOKEN: ${{ secrets.TOKEN }}
run: |
poetry run python -c 'import os;print(os.environ)'
poetry run python daily_scrape.py
poetry run python monthly_scrape.py
poetry run python fuel_types.py
#----------------------------------------------
# publish to github
#----------------------------------------------
- uses: mikeal/publish-to-github-action@master
env:
BRANCH_NAME: 'master'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}