forked from repo-mirrors/cnpg-postgres-containers
Generate default cluster image catalogs for all combinations of types and OS versions, including all supported PostgreSQL versions. The catalogs also include predefined labels to easily identify the type, OS version, date, and origin of the catalog. Closes cloudnative-pg/artifacts#1 Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com> Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com> Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
66 lines
1.7 KiB
YAML
66 lines
1.7 KiB
YAML
name: Bake Images
|
|
|
|
on:
|
|
schedule:
|
|
# Build images once a week, on Mondays
|
|
- cron: 0 8 * * 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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
|
|
|
- name: Get supported PostgreSQL versions
|
|
id: get_versions
|
|
run: |
|
|
VERSIONS="$(sed -n '/postgreSQL\(Versions\|PreviewVersions\) = \[/,/\]/ s/.*"\([0-9][0-9]*\)[.~][^"]*".*/\1/p' docker-bake.hcl | 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: ./.github/workflows/bake_targets.yml
|
|
with:
|
|
environment: ${{ github.event.inputs.environment }}
|
|
postgresql_version: ${{ matrix.version }}
|
|
|
|
Catalogs:
|
|
name: Update Catalogs
|
|
needs: Bake
|
|
runs-on: ubuntu-24.04
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Repository Dispatch
|
|
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3
|
|
with:
|
|
event-type: update-catalogs
|