-
Notifications
You must be signed in to change notification settings - Fork 93
59 lines (52 loc) · 1.64 KB
/
update-database.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
name: Update Database
on:
push:
branches:
- main
jobs:
update-database:
runs-on: ubuntu-latest
steps:
# Python & dependency installation
- uses: actions/checkout@v3
- name: Yaml file linting
run: |
docker run --rm \
-v $(pwd):/code \
registry.gitlab.com/pipeline-components/yamllint:latest \
-s .
- name: setup Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: install Poetry
uses: snok/install-poetry@v1.3.3
- name: cache Poetry virtualenv
uses: actions/cache@v3
id: cache
with:
path: ~/.virtualenvs/
key: poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
poetry-${{ hashFiles('**/poetry.lock') }}
- name: set poetry config path
run: poetry config virtualenvs.path ~/.virtualenvs
- name: install dependencies
run: poetry install
# if: steps.cache.outputs.cache-hit != 'true'
- name: people to S3
run: poetry run os-people to-csv --upload
env:
OS_PEOPLE_DIRECTORY: ${{ env.GITHUB_WORKSPACE }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: people to database
run: poetry run os-people to-database
env:
OS_PEOPLE_DIRECTORY: ${{ env.GITHUB_WORKSPACE }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
- name: committees to database
run: poetry run os-committees to-database --purge
env:
OS_PEOPLE_DIRECTORY: ${{ env.GITHUB_WORKSPACE }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}