Skip to content

Bake Images

Bake Images #40

Workflow file for this run

name: Bake Images
on:
schedule:
# Build images once a week, on Mondays
- cron: 0 10 * * 1
workflow_dispatch:
inputs:
environment:
type: choice
options:
- testing
- production
default: testing
description: "Choose the environment to bake the target for"
permissions: {}
jobs:
get_versions:
name: Get PostgreSQL versions
runs-on: ubuntu-24.04
permissions:
contents: read
outputs:
versions: ${{ steps.get_versions.outputs.versions }}
steps:
- name: Checkout Code
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- name: Get supported PostgreSQL versions
id: get_versions
run: |
VERSIONS="$(curl -s https://raw.githubusercontent.com/cloudnative-pg/postgres-containers/refs/heads/main/docker-bake.hcl \
| sed -n '/postgreSQL\(Versions\|PreviewVersions\) = \[/,/\]/ s/.*"\([0-9][0-9]*\)[.~][^"]*".*/\1/p' \
| sort -nu | paste -sd,)"
echo "PostgreSQL versions: [$VERSIONS]"
echo "versions=[$VERSIONS]" >> "$GITHUB_OUTPUT"
Bake:
name: Bake
needs: get_versions
permissions:
packages: write
contents: read
id-token: write
security-events: write
strategy:
fail-fast: false
matrix:
version: ${{ fromJson(needs.get_versions.outputs.versions) }}
uses: cloudnative-pg/postgres-containers/.github/workflows/bake_targets.yml@main
with:
environment: ${{ github.event.inputs.environment }}
postgresql_version: ${{ matrix.version }}
target: "postgis"
bake_files: "./source/docker-bake.hcl,./docker-bake.hcl"
bake_remote_source: "cloudnative-pg/postgres-containers"
secrets:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
Catalogs:
name: Update Catalogs
needs: Bake
runs-on: ubuntu-24.04
permissions:
contents: write
if: |
github.ref == 'refs/heads/main' &&
( github.event.inputs.environment == 'production' || github.event_name == 'schedule' )
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4
with:
event-type: update-catalogs