Skip to content
Merged
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
115 changes: 115 additions & 0 deletions .github/workflows/build-pg17-kilobase-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: Build PostgreSQL 17 with Kilobase Extension

on:
workflow_dispatch:
inputs:
tag_name:
description: 'Docker image tag (e.g., 17.4.1.069-kilobase)'
required: true
default: '17.4.1.069-kilobase'
release_name:
description: 'Release name'
required: true
default: 'PostgreSQL 17 with Kilobase Extension'

permissions:
contents: write
packages: write
id-token: write

jobs:
build-pg17-image:
runs-on: ubuntu-latest
timeout-minutes: 180
steps:
- name: Checkout Repo
uses: supabase/postgres/.github/actions/shared-checkout@HEAD

- uses: DeterminateSystems/nix-installer-action@main

- run: docker context create builders

- uses: docker/setup-buildx-action@v3
with:
endpoint: builders

- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Get build args
id: args
run: |
nix run nixpkgs#nushell -- -c '
open ansible/vars.yml
| items { |key value| {name: $key, item: $value} }
| where { |it| ($it.item | describe) == "string" }
| each { |it| $"($it.name)=($it.item)" }
| str join "\n"
| save --append $env.GITHUB_OUTPUT
'

- name: Build and push Docker image
id: build
uses: docker/build-push-action@v5
with:
push: true
build-args: |
${{ steps.args.outputs.result }}
target: production
tags: |
ghcr.io/${{ github.repository_owner }}/postgres:${{ inputs.tag_name }}
ghcr.io/${{ github.repository_owner }}/postgres:latest-kilobase
platforms: linux/amd64
cache-from: type=gha,scope=${{ github.ref_name }}-pg17-kilobase
cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-pg17-kilobase
file: Dockerfile-17

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ inputs.tag_name }}
name: ${{ inputs.release_name }}
body: |
## PostgreSQL 17 Docker Image with Kilobase Extension

This release contains a complete PostgreSQL 17 Docker image with the kilobase extension included.

### Docker Image:
```bash
docker pull ghcr.io/${{ github.repository_owner }}/postgres:${{ inputs.tag_name }}
```

### CNPG Cluster Usage:
```yaml
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: postgres-kilobase
spec:
instances: 3
imageName: ghcr.io/${{ github.repository_owner }}/postgres:${{ inputs.tag_name }}
postgresql:
shared_preload_libraries:
- "pg_stat_statements"
- "pg_failover_slots"
bootstrap:
initdb:
postInitSQL:
- "CREATE EXTENSION IF NOT EXISTS kilobase;"
```

### Extensions Included:
- kilobase (PostgreSQL extension built with pgrx 0.15.0)
- pg_failover_slots
- All standard Supabase extensions

### Build Details:
- PostgreSQL 17
- Built for: linux/amd64
- Base: Supabase PostgreSQL distribution
- Built with Nix reproducible builds
draft: false
prerelease: false
Loading