1+ name : Build PostgreSQL 17 with Kilobase Extension
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ tag_name :
7+ description : ' Docker image tag (e.g., 17.4.1.069-kilobase)'
8+ required : true
9+ default : ' 17.4.1.069-kilobase'
10+ release_name :
11+ description : ' Release name'
12+ required : true
13+ default : ' PostgreSQL 17 with Kilobase Extension'
14+
15+ permissions :
16+ contents : write
17+ packages : write
18+ id-token : write
19+
20+ jobs :
21+ build-pg17-image :
22+ runs-on : ubuntu-latest
23+ timeout-minutes : 180
24+ steps :
25+ - name : Checkout Repo
26+ uses : supabase/postgres/.github/actions/shared-checkout@HEAD
27+
28+ - uses : DeterminateSystems/nix-installer-action@main
29+
30+ - run : docker context create builders
31+
32+ - uses : docker/setup-buildx-action@v3
33+ with :
34+ endpoint : builders
35+
36+ - uses : docker/login-action@v2
37+ with :
38+ registry : ghcr.io
39+ username : ${{ github.actor }}
40+ password : ${{ secrets.GITHUB_TOKEN }}
41+
42+ - name : Get build args
43+ id : args
44+ run : |
45+ nix run nixpkgs#nushell -- -c '
46+ open ansible/vars.yml
47+ | items { |key value| {name: $key, item: $value} }
48+ | where { |it| ($it.item | describe) == "string" }
49+ | each { |it| $"($it.name)=($it.item)" }
50+ | str join "\n"
51+ | save --append $env.GITHUB_OUTPUT
52+ '
53+
54+ - name : Build and push Docker image
55+ id : build
56+ uses : docker/build-push-action@v5
57+ with :
58+ push : true
59+ build-args : |
60+ ${{ steps.args.outputs.result }}
61+ target : production
62+ tags : |
63+ ghcr.io/${{ github.repository_owner }}/postgres:${{ inputs.tag_name }}
64+ ghcr.io/${{ github.repository_owner }}/postgres:latest-kilobase
65+ platforms : linux/amd64
66+ cache-from : type=gha,scope=${{ github.ref_name }}-pg17-kilobase
67+ cache-to : type=gha,mode=max,scope=${{ github.ref_name }}-pg17-kilobase
68+ file : Dockerfile-17
69+
70+ - name : Create GitHub Release
71+ uses : softprops/action-gh-release@v1
72+ with :
73+ tag_name : ${{ inputs.tag_name }}
74+ name : ${{ inputs.release_name }}
75+ body : |
76+ ## PostgreSQL 17 Docker Image with Kilobase Extension
77+
78+ This release contains a complete PostgreSQL 17 Docker image with the kilobase extension included.
79+
80+ ### Docker Image:
81+ ```bash
82+ docker pull ghcr.io/${{ github.repository_owner }}/postgres:${{ inputs.tag_name }}
83+ ```
84+
85+ ### CNPG Cluster Usage:
86+ ```yaml
87+ apiVersion: postgresql.cnpg.io/v1
88+ kind: Cluster
89+ metadata:
90+ name: postgres-kilobase
91+ spec:
92+ instances: 3
93+ imageName: ghcr.io/${{ github.repository_owner }}/postgres:${{ inputs.tag_name }}
94+ postgresql:
95+ shared_preload_libraries:
96+ - "pg_stat_statements"
97+ - "pg_failover_slots"
98+ bootstrap:
99+ initdb:
100+ postInitSQL:
101+ - "CREATE EXTENSION IF NOT EXISTS kilobase;"
102+ ```
103+
104+ ### Extensions Included:
105+ - kilobase (PostgreSQL extension built with pgrx 0.15.0)
106+ - pg_failover_slots
107+ - All standard Supabase extensions
108+
109+ ### Build Details:
110+ - PostgreSQL 17
111+ - Built for: linux/amd64
112+ - Base: Supabase PostgreSQL distribution
113+ - Built with Nix reproducible builds
114+ draft : false
115+ prerelease : false
0 commit comments