Skip to content

Use docker buildx to ensure images for multi platforms are saved #1

Use docker buildx to ensure images for multi platforms are saved

Use docker buildx to ensure images for multi platforms are saved #1

name: OpenShift Certification

Check failure on line 1 in .github/workflows/openshift-certification.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/openshift-certification.yml

Invalid workflow file

(Line: 43, Col: 12): Unexpected symbol: '|'. Located at position 17 within expression: inputs.platform | tr '/' '-'
on:
workflow_call:
inputs:
runner:
required: false
type: string
default: 'ubuntu-24.04'
image:
required: true
type: string
platform:
required: true
type: string
defaults:
run:
shell: bash
permissions:
contents: read
jobs:
preflight:
runs-on: ${{ inputs.runner }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download preflight binary
run: |
curl -LO https://github.com/redhat-openshift-ecosystem/openshift-preflight/releases/latest/download/preflight-linux-amd64
chmod +x preflight-linux-amd64
sudo mv preflight-linux-amd64 /usr/local/bin/preflight
- name: Download image artifact
uses: actions/download-artifact@v4
with:
name: ${{ inputs.image }}-images # or ${{ inputs.image }}-linux-${{ inputs.platform | tr '/' '-' }}
- name: Load image into Docker
run: docker load -i ${{ inputs.image }}-${{ inputs.platform | tr '/' '-' }}.tar
- name: Retag image for preflight
run: |
loaded_tag="ghcr.io/${{ github.repository_owner }}/nginx-gateway-fabric/${{ inputs.image }}:${{ inputs.image_version }}"
preflight_tag="${{ inputs.image }}:ubi"
docker tag "$loaded_tag" "$preflight_tag"
- name: Run preflight
env:
PYXIS_API_TOKEN: ${{ secrets.PYXIS_API_TOKEN }}
run: preflight check container ${{ inputs.image }}:ubi > preflight-result.json
- name: Check preflight results
run: |
failed_count=$(jq '.results.failed | length' preflight-result.json)
if [ "$failed_count" -ne 0 ]; then
echo "Preflight checks failed: $failed_count failed checks"
echo "Results for preflight-result.json:"
jq '.results.failed' preflight-result.json
exit 1
fi