Skip to content

Publish

Publish #24

Workflow file for this run

name: Publish
on:
workflow_dispatch:
inputs:
version:
description: 'Define version to be built and tested (example: "1.13.4")'
required: true
jobs:
set-olm-tag:
runs-on: ubuntu-20.04
outputs:
olm-tag: ${{ steps.set.outputs.OLM_TAG }}
steps:
- uses: actions/checkout@v1
- id: set
name: Set OLM Tag
run: |
VERSION="${{ github.event.inputs.version }}"
set -o pipefail
olm_tag=$(yq .spec.install.spec.deployments[0].spec.template.spec.containers[0].image bundles/cilium.v${VERSION#v}/manifests/cilium.clusterserviceversion.yaml | cut -d ':' -f 2)
echo "::set-output name=OLM_TAG::${olm_tag}"
build-and-publish:
if: needs.set-olm-tag.outputs.olm-tag != ''
env:
PREFLIGHT_VERSION: 1.2.1
OLM_TAG: ${{ needs.set-olm-tag.outputs.olm-tag }}
name: Build Images and Validate Images
runs-on: ubuntu-20.04
needs: set-olm-tag
steps:
- uses: actions/checkout@v1
- name: Set up QEMU
uses: docker/setup-qemu-action@8b122486cedac8393e77aa9734c3528886e4a1a8
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@dc7b9719a96d48369863986a06765841d7ea23f6
- name: Login to scan.connect.redhat.com
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b
with:
registry: quay.io
username: redhat-isv-containers+5fbe31ec8b7d4976604cbde0-robot
password: ${{ secrets.RHCP_OLM_REGISTRY_PASSWORD }}
- name: Push to Quay.io
uses: docker/build-push-action@e551b19e49efd4e98792db7592c17c09b89db8d8
with:
context: ./operator/cilium.v${{ github.event.inputs.version }}/
push: true
tags: quay.io/redhat-isv-containers/5fbe31ec8b7d4976604cbde0:${{ env.OLM_TAG }}
- name: Install Preflight
run: |
curl -L https://github.com/redhat-openshift-ecosystem/openshift-preflight/releases/download/${{ env.PREFLIGHT_VERSION }}/preflight-linux-amd64 -o preflight-linux-amd64
sha256sum --check .github_workflow_assets/preflight-linux-amd64.sha256sum
sudo chmod +x preflight-linux-amd64
sudo mv preflight-linux-amd64 /usr/local/bin/preflight
- name: Run Preflight
run: |
ls ~/.docker
cat ~/.docker/config.json
preflight check container \
--pyxis-api-token=${{ secrets.RHCP_PREFLIGHT_API_KEY }} \
-d ~/.docker/config.json \
--submit \
--certification-project-id=5fbe31ec8b7d4976604cbde0 \
quay.io/redhat-isv-containers/5fbe31ec8b7d4976604cbde0:${{ env.OLM_TAG }}