Skip to content

OpenGov/action-setup-postgis

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

setup-postgis

GitHub CI build Marketplace

Tip

PostgreSQL installation is done by the ikalnytskyi/action-setup-postgres action. All parameters are passed as is to the original action, with the addition of the cached-dir parameter to specify where to download and cache PostGIS binaries. See the original documentation for more details.

  • Runs on all Linux, macOS and Windows GitHub runners
  • Installs the correct version of PostGIS and runs CREATE EXTENSION postgis in the new database.

See also action-setup-nginx to configure NGINX service.

Usage

steps:
  - uses: nyurik/action-setup-postgis@v2
    id: postgres

  - name: Test PostGIS is installed
    run: psql -v ON_ERROR_STOP=1 -c 'SELECT PostGIS_Full_Version();' "$CONNECTION_STR"
    env:
      CONNECTION_STR: ${{ steps.postgres.outputs.connection-uri }}

Input parameters

Key Value Default
username The username of the user to setup. postgres
password The password of the user to setup. postgres
database The database name to setup and grant permissions to created user. postgres
port The server port to listen on. ARM64 runner collide on 5432 5432
postgres-version The PostgreSQL version to install. MacOS only supports 14 and 17 17
postgis_version The PostGIS version to install. By default (empty), will use the latest. See available versions here. If set, must use the entire version string like 3.3.3
cached-dir Where should the temporary downloads be placed. Used to download and cache PostGIS binary. ${{ runner.temp }}/setup-postgis-downloads
import-schema Import database schema. false
schema-file Path to the SQL schema file to import (relative to workspace or absolute path). "" (empty)
setup-odbc Configure ODBC drivers. false
search-path Default schema search path for database and user. "" (empty)
additional-extensions Comma-separated list of additional PostgreSQL extensions to install (beyond PostGIS). "" (empty)

Outputs

Key Description Example
connection-uri The connection URI to connect to PostgreSQL. postgresql://postgres:postgres@localhost/postgres
service-name The service name with connection parameters. postgres
npgsql-connection-string Npgsql connection string with search path. Host=localhost;Port=5432;Database=postgres;Username=postgres;Password=postgres;Search Path=;
odbc-connection-string ODBC connection string. Driver={PostgreSQL ANSI};Servername=localhost;Port=5432;Database=postgres;Username=postgres;Password=postgres;

User permissions

Key Value
usesuper true
usecreatedb true

License

The scripts and documentation in this project are released under the MIT License.

About

Setup a PostgreSQL+PostGIS for Linux, macOS and Windows runner machines.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published