Skip to content

Commit

Permalink
ci: try now
Browse files Browse the repository at this point in the history
  • Loading branch information
dr5hn committed Jun 8, 2024
1 parent 6da3454 commit 573c434
Showing 1 changed file with 27 additions and 9 deletions.
36 changes: 27 additions & 9 deletions .github/workflows/export.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@ jobs:
node-version: [20.x]
fail-fast: false

services:
postgres:
image: postgres:latest
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -53,7 +66,6 @@ jobs:
run: |
sudo systemctl start postgresql.service
pg_isready
sudo -u postgres createuser -s -d -r -w root
- name: Add clean commands to world.sql
run: |
Expand All @@ -65,9 +77,13 @@ jobs:
echo -e "DROP TABLE IF EXISTS \`cities\`;\n$(cat sql/world.sql)" > sql/world.sql
- name: Setup PostgreSQL DB
env:
PGPASSWORD: postgres
run: |
psql -U root -c "CREATE DATABASE world;"
psql -U root -c "\l"
echo "*:*:world:postgres:postgres" > $HOME/.pgpass
chmod 0600 $HOME/.pgpass
psql -U postgres -c "CREATE DATABASE world;"
psql -U postgres -c "\l"
- name: Setup MySQL DB
run: |
Expand Down Expand Up @@ -123,13 +139,15 @@ jobs:
mysqldump -uroot -proot --add-drop-table --disable-keys --set-charset --skip-add-locks world cities > sql/cities.sql
- name: Export PostgreSQL SQL
env:
PGPASSWORD: postgres
run: |
pg_dump -U root -t regions world > psql/regions.sql
pg_dump -U root -t subregions world > psql/subregions.sql
pg_dump -U root -t countries world > psql/countries.sql
pg_dump -U root -t states world > psql/states.sql
pg_dump -U root -t cities world > psql/cities.sql
pg_dump -U root world > psql/world.sql
pg_dump --dbname=postgresql://postgres:postgres@localhost/world -t regions > psql/regions.sql
pg_dump --dbname=postgresql://postgres:postgres@localhost/world -t subregions > psql/subregions.sql
pg_dump --dbname=postgresql://postgres:postgres@localhost/world -t countries > psql/countries.sql
pg_dump --dbname=postgresql://postgres:postgres@localhost/world -t states > psql/states.sql
pg_dump --dbname=postgresql://postgres:postgres@localhost/world -t cities > psql/cities.sql
pg_dump --dbname=postgresql://postgres:postgres@localhost/world > psql/world.sql
- name: Update README.md
run: |
Expand Down

0 comments on commit 573c434

Please sign in to comment.