Skip to content

Build and Push Container #50

Build and Push Container

Build and Push Container #50

Workflow file for this run

name: Build and Push Container
on:
workflow_dispatch:
inputs:
postgres-major-version:
description: "Postgres major version to release."
type: string
required: true
charts:
description: "Json list with helm charts to upgrade."
type: string
required: true
workflow_call:
inputs:
postgres-major-version:
description: "Postgres major version to release."
type: string
required: true
charts:
description: "Json list with helm charts to upgrade."
type: string
required: true
secrets:
COSIGN_KEY_OPENSIGHT:
required: true
COSIGN_KEY_PASSWORD_OPENSIGHT:
required: true
GREENBONE_BOT_TOKEN:
required: true
permissions:
contents: read
packages: write
id-token: write
pull-requests: write
jobs:
push-postgres:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build and Push
id: build
uses: greenbone/actions/container-build-push-generic@pholthaus/dockerv5
with:
build-args: "POSTGRES_VERSION=${{ inputs.postgres-major-version }}"
cosign-key: ${{ secrets.COSIGN_KEY_OPENSIGHT }}
cosign-key-password: ${{ secrets.COSIGN_KEY_PASSWORD_OPENSIGHT }}
cosign-tlog-upload: "false"
image-url: ${{ github.repository }}
image-labels: |
org.opencontainers.image.vendor=Greenbone
org.opencontainers.image.base.name=postgres:${{ inputs.postgres-major-version }}
image-tags: |
type=raw,value=${{ inputs.postgres-major-version }}
registry: ${{ vars.IMAGE_REGISTRY }}
registry-username: ${{ github.actor }}
registry-password: ${{ secrets.GITHUB_TOKEN }}
meta-annotations-levels: 'manifest,index,manifest-descriptor,index-descriptor'
- name: Helm upgrade matrix
id: upgrade
run: |
echo "matrix=$(echo '${{ inputs.charts }}' | jq -r '{include:[.[] | {chart: ., digest: "${{ steps.build.outputs.digest }}" }]} | @json')" >> $GITHUB_OUTPUT