Skip to content

Database Export

Database Export #42

Workflow file for this run

name: Database Export
on:
workflow_dispatch: # Add a run button on GitHub
push:
tags:
- "*"
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: hapi
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
--name postgres-container
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r requirements.txt
pip install .
- name: Run Pipeline
run: python3.11 -m hapi.pipelines.app -db "postgresql+psycopg://postgres:postgres@localhost:5432/hapi"
env:
HDX_KEY: ${{ secrets.HDX_BOT_SCRAPERS_API_TOKEN }}
- name: Dump PostgreSQL Views
run: |
./dump_views.sh
- name: Commit updated DB export
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: db-export
folder: csv_export
target-folder: database