-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (56 loc) · 1.64 KB
/
pipeline-main.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
name: Pipeline Domain Data Ingestion
on:
workflow_dispatch:
schedule:
- cron: "0 22 1 * *" # At 22:00 on day-of-month 1.
env:
DEBUG: false
jobs:
migrate:
name: Run Database Migrations
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl proxy 5432:5432 -a checkstatusgovbr-db &> /dev/null &
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Execute alembic migrations
run: |
pip install -U pip
pip install poetry
poetry install
poetry run alembic upgrade head
working-directory: api
env:
POETRY_VIRTUALENVS_CREATE: false
DATABASE_URL: ${{ secrets.DATABASE_URL }}
ingestion:
needs: migrate
name: Run Data Ingestion
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl proxy 5432:5432 -a checkstatusgovbr-db &> /dev/null &
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Execute ingestion
run: |
pip install -U pip
pip install poetry
poetry install
python src/main.py
working-directory: pipeline
env:
POETRY_VIRTUALENVS_CREATE: false
DATABASE_URL: ${{ secrets.DATABASE_URL }}
PYTHONPATH: ../