-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (52 loc) · 1.46 KB
/
run.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
name: Scrape PDFs, parse, and transform
on:
# Run this job at 15:00 UTC every day
schedule:
- cron: "0 15 * * *"
# Also allow the job to be manually triggered
workflow_dispatch:
permissions:
contents: write
jobs:
fetch:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Check-out the repo
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Python venv and requirements
run: make venv
- name: Configure git
run: git config --global user.name "Automated"; git config user.email "[email protected]"
- name: Log Python packages
run: |
source venv/bin/activate
pip freeze
- name: Log Python version and path
run: |
source venv/bin/activate
python --version
which python
# Scrape TSA website for new PDFs
- name: Scrape
run: |
source venv/bin/activate
make scrape
git add pdfs
git diff --cached --quiet || git commit -m "Add new/updated TSA complaint PDFs"
git push
# Parse new PDFs and transform data
- name: Parse and transform
run: |
source venv/bin/activate
make transform
git add output
git diff --cached --quiet || git commit -m "Parse new PDFs and transform data"
git push