Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,15 @@ jobs:

echo "✓ Database credentials fetched successfully"

# Install PostgreSQL client
sudo apt-get update
sudo apt-get install -y postgresql-client
# The runner image already ships PostgreSQL (only the service is disabled), so
# psql is normally on PATH. Install only if that stops being true.
if command -v psql > /dev/null; then
psql --version
else
echo "psql not on the runner image; installing"
sudo apt-get update
sudo apt-get install -y --no-install-recommends postgresql-client
fi

echo 'loading North American ecoregions into database'
psql -c "CREATE SCHEMA IF NOT EXISTS features; DROP TABLE IF EXISTS features.ecoregions;"
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/reset-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,19 @@ jobs:
fi
echo "Confirmed: deleting non-fixture collections from '$PROJECT'."

- name: Install PostgreSQL client
# The ubuntu-24.04 runner image already ships PostgreSQL (only the *service* is
# disabled), so psql is normally on PATH and installing it cost ~9s of `apt-get
# update` for nothing. Kept as a fallback rather than deleted, so this still works
# if a future image drops it.
- name: Ensure psql
run: |
sudo apt-get update
sudo apt-get install -y postgresql-client
if command -v psql > /dev/null; then
psql --version
else
echo "psql not on the runner image; installing"
sudo apt-get update
sudo apt-get install -y --no-install-recommends postgresql-client
fi

- name: Reset collections
env:
Expand Down