Repository navigation
105 lines (96 loc) · 3.19 KB
/
Copy pathprocess-csv-postgres.yml
File metadata and controls
105 lines (96 loc) · 3.19 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: process-csv-postgres-external
on:
workflow_dispatch:
inputs:
csv_path:
description: "Path to the CSV file to process (relative to the educup/educup-scripts repo)."
required: true
type: string
state:
description: "State abbreviation (e.g., TX)."
required: true
type: string
speciality:
description: "Speciality label to store with the record."
required: true
type: string
email_column:
description: "CSV column containing the email address."
required: true
type: string
npn_column:
description: "CSV column containing the NPN number."
required: true
type: string
lastname_column:
description: "CSV column containing the last name."
required: true
type: string
workflow_call:
inputs:
csv_path:
description: "Path to the CSV file to process (relative to the educup/educup-scripts repo)."
required: true
type: string
state:
description: "State abbreviation (e.g., TX)."
required: true
type: string
speciality:
description: "Speciality label to store with the record."
required: true
type: string
email_column:
description: "CSV column containing the email address."
required: true
type: string
npn_column:
description: "CSV column containing the NPN number."
required: true
type: string
lastname_column:
description: "CSV column containing the last name."
required: true
type: string
jobs:
run:
env:
UV_CACHE_DIR: /tmp/.uv-cache
DATABASE_URL: ${{ secrets.DATABASE_URL }}
runs-on: ubuntu-slim
steps:
- name: Checkout processing scripts repository (educup/educup-scripts)
uses: actions/checkout@v4
with:
repository: "educup/educup-scripts"
fetch-depth: 1
lfs: true
# If the repository is private, provide a token with the secret `GH_PAT`.
# For public repositories, it can be omitted.
token: ${{ secrets.GH_PAT }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Restore uv cache
uses: actions/cache@v4
with:
path: /tmp/.uv-cache
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}
- name: Install project dependencies
run: uv sync --all-groups --all-extras
- name: Process CSV and push to PostgreSQL
run: |
uv run cli process-csv-postgres "${{ inputs.csv_path }}" \
--state "${{ inputs.state }}" \
--speciality "${{ inputs.speciality }}" \
--email-column "${{ inputs.email_column }}" \
--npn-column "${{ inputs.npn_column }}" \
--lastname-column "${{ inputs.lastname_column }}"
- name: Minimize uv cache
run: uv cache prune --ci