55 inputs :
66 patch_id :
77 description : " ID of the Patch"
8- required : false
8+ required : true
99 major_version :
1010 description : " PostgreSQL major version (leave empty for default)"
1111 required : false
1212
13- # set up environment variables to be used across all the jobs
14- env :
15- REGISTRY : " ghcr.io/${{ github.repository_owner }}/postgresql-trunk"
16- BRANCH : " master"
17-
1813defaults :
1914 run :
2015 # default failure handling for shell scripts in 'run' steps
2823 contents : read
2924 packages : write
3025 outputs :
31- pg_image : " ${{ env.REGISTRY }}:${{ env.TAG }} "
26+ images : ${{ env.IMAGES }}
3227 steps :
3328 - name : Checkout Code
3429 uses : actions/checkout@v4
4742 fi
4843
4944 - name : Set commitfest branch and tag
50- if : github.event.inputs.patch_id != ''
5145 run : |
5246 BRANCH="cf/${{ github.event.inputs.patch_id }}"
53- TAG="${{ env.PG_MAJOR }}-${ BRANCH////-}"
47+ TAG="${BRANCH////-}"
5448 echo "TAG=${TAG}" >> $GITHUB_ENV
5549 echo "BRANCH=${BRANCH}" >> $GITHUB_ENV
5650
@@ -61,17 +55,31 @@ jobs:
6155 username : ${{ github.actor }}
6256 password : ${{ secrets.GITHUB_TOKEN }}
6357
58+ - name : Set up Docker Buildx
59+ uses : docker/setup-buildx-action@v3
60+
6461 - name : Build and push
65- uses : docker/build-push-action@v6
62+ uses : docker/bake-action@v6
63+ id : build
64+ env :
65+ environment : production
66+ registry : ghcr.io/${{ github.repository_owner }}
67+ revision : ${{ github.sha }}
68+ pgMajor : ${{ env.PG_MAJOR }}
6669 with :
67- context : .
70+ set : |
71+ *.args.PG_REPO=https://github.com/postgresql-cfbot/postgresql.git
72+ *.args.PG_BRANCH=${{ env.BRANCH }}
73+ minimal.tags=${{ env.registry }}/postgresql-trunk:18-minimal-${{ env.TAG }}
74+ standard.tags=${{ env.registry }}/postgresql-trunk:18-standard-${{ env.TAG }}
75+ postgis.tags=${{ env.registry }}/postgresql-trunk:18-postgis-${{ env.TAG }}
6876 push : true
69- load : false
70- tags : |
71- ${{ env.REGISTRY }}:${{ env.TAG }}
72- build-args : |
73- PG_REPO=https://github.com/postgresql-cfbot/postgresql.git
74- PG_BRANCH=$ {{ env.BRANCH }}
77+
78+ # Get a list of the images that were built and pushed.
79+ - name : Generated images
80+ id : images
81+ run : |
82+ echo "IMAGES=$(echo '$ {{ steps.build.outputs.metadata }}' | jq -c '.[]."image.name"')" >> $GITHUB_ENV
7583
7684 generate-summary :
7785 name : Commitfest Image Build summary
@@ -83,11 +91,15 @@ jobs:
8391 run : |
8492 commitFestPatchID=${{ github.event.inputs.patch_id }}
8593 commitFestURL="https://commitfest.postgresql.org/patch/${commitFestPatchID}"
86- image="${{ needs.build-pg.outputs.pg_image }}"
87- imageURL="https://${image}"
94+ image="${{ needs.build-pg.outputs.images }}"
95+ images_list="$(echo $images | jq -r | tr ' ' '\n' | sed 's/^/https:\/\//')"
96+ standardImage="$(echo $images | jq -r | grep standard)"
97+
8898 echo "# Commitfest Image Build summary" >> $GITHUB_STEP_SUMMARY
8999 echo "**Commitfest Patch URL**: [$commitFestPatchID]($commitFestURL)" >> $GITHUB_STEP_SUMMARY
90- echo "**Container Image**: [$image]($imageURL)" >> $GITHUB_STEP_SUMMARY
100+ echo "Here's the list of Container Images that have been built:" >> $GITHUB_STEP_SUMMARY
101+ echo "$images_list" >> $GITHUB_STEP_SUMMARY
102+
91103 echo "## CloudNativePG Cluster definition" >> $GITHUB_STEP_SUMMARY
92104 echo "You can create a cluster in CloudNativePG running this image:" >> $GITHUB_STEP_SUMMARY
93105 echo "\`\`\`sh" >> $GITHUB_STEP_SUMMARY
97109 echo "metadata:" >> $GITHUB_STEP_SUMMARY
98110 echo " name: commitfest-$commitFestPatchID" >> $GITHUB_STEP_SUMMARY
99111 echo "spec:" >> $GITHUB_STEP_SUMMARY
100- echo " imageName: $image " >> $GITHUB_STEP_SUMMARY
112+ echo " imageName: $standardImage " >> $GITHUB_STEP_SUMMARY
101113 echo " instances: 3" >> $GITHUB_STEP_SUMMARY
102114 echo " storage:" >> $GITHUB_STEP_SUMMARY
103115 echo " size: 1Gi" >> $GITHUB_STEP_SUMMARY
0 commit comments