-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (63 loc) · 2.03 KB
/
scrape.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [main]
pull_request:
branches: [main]
schedule:
# Run at every 5th minute past every hour from 9 through 18 on every
# day-of-week from Wednesday through Sunday
# https://crontab.guru/#*/5_9-18_*_*_0,3-6
- cron: "*/5 9-18 * * 0,3-6"
# Run every hour outside of the hot period above
- cron: "30 0-8,18-23 * * *"
- cron: "30 9-18 * * 1-2"
# TOO FREQUENT:
# - cron: "*/5 * * * *" # run every 5 minutes (https://crontab.guru/#*/5_*_*_*_*)
name: Scrape Hopewell Quarry Availability
jobs:
update-logs:
name: Scrape Etix Availability
runs-on: ubuntu-latest
permissions:
actions: write
checks: write
contents: write
deployments: write
pull-requests: write
repository-projects: write
steps:
- name: Check out repository code
uses: actions/checkout@v2
# Setup Python (faster than using Python container)
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install pipenv
run: |
python -m pip install --upgrade pipenv wheel
- name: Check pipenv cache before installing dependencies
id: cache-pipenv
uses: actions/cache@v1
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
- name: Install dependencies
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: |
touch Pipfile
pipenv install --deploy --dev
- name: Scrape Etix and output logs
run: |
pipenv run python ./script.py
- name: Commit generated logs 🚀
uses: EndBug/add-and-commit@v9
with:
message: "Commit updated data"
add: "./*.json"
cwd: "."
force: true
default_author: github_actions
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}