updated workflow order #29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create SQL Documentation | |
on: push | |
jobs: | |
runner-job: | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: write | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_PASSWORD: postgres | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
- name: Create tables and insert data | |
run: psql -U postgres -h localhost -d postgres -p 5432 < data/flensburg_sozialatlas.sql | |
env: | |
PGPASSWORD: postgres | |
- name: Create meta tables and insert data | |
run: psql -U postgres -h localhost -d postgres -p 5432 < data/flensburg_sozialatlas_metadaten.sql | |
env: | |
PGPASSWORD: postgres | |
- name: Generate documentation | |
run: python3 generate_documentation.py | |
env: | |
DB_NAME: postgres | |
DB_PASS: postgres | |
DB_USER: postgres | |
DB_HOST: localhost | |
DB_PORT: 5432 | |
- name: Commit sql documentation | |
run: | | |
if [[ $(git status --porcelain | wc -l) -gt 0 ]]; then | |
git config --global user.name 'OK Lab Flensburg' | |
git config --global user.email 'oklabflensburg@users.noreply.github.com' | |
git add 'SQL.md' | |
git commit -m 'add automated sql documentation' | |
git push | |
fi |