Skip to content

Commit

Permalink
[DNM] check image build
Browse files Browse the repository at this point in the history
  • Loading branch information
karelyatin committed Feb 29, 2024
1 parent b2df456 commit f609375
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 27 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/build-openstack-operator.yaml

This file was deleted.

60 changes: 60 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: openstack operator image builder

on:
push:
branches:
- '*'

env:
imageregistry: 'quay.io'
imagenamespace: 'openstack-k8s-operators'
latesttag: latest

jobs:
build-operator-index:
name: operator-index
runs-on: ubuntu-latest

steps:
- name: Checkout ${{ inputs.operator_name }}-operator repository
uses: actions/checkout@v4

- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v7

- name: Set latest tag for non main branch
if: "${{ steps.branch-name.outputs.current_branch != 'main' }}"
run: |
echo "latesttag=${{ steps.branch-name.outputs.current_branch }}-latest" >> $GITHUB_ENV
- name: Install opm
uses: redhat-actions/openshift-tools-installer@v1
with:
source: github
opm: 'latest'

- name: Create index image
shell: bash
run: |
pushd "${GITHUB_WORKSPACE}"
git status
git diff
go version
go list -mod=readonly -m -json all || true
go list -m -json all || true
CATALOG_EXTRA_BUNDLES=""
CATALOG_EXTRA_BUNDLES=$(/bin/bash ./hack/pin-bundle-images.sh)
make tidy
git status
git diff
opm index add --bundles "${REGISTRY}/${BUNDLE_IMAGE}:${GITHUB_SHA}${CATALOG_EXTRA_BUNDLES}" --tag "${REGISTRY}/${INDEX_IMAGE}:${GITHUB_SHA}" -u podman --pull-tool podman
podman tag "${REGISTRY}/${INDEX_IMAGE}:${GITHUB_SHA}" "${REGISTRY}/${INDEX_IMAGE}:${INDEX_IMAGE_TAG}"
popd
env:
REGISTRY: ${{ env.imageregistry }}/${{ env.imagenamespace }}
GITHUB_SHA: ${{ github.sha }}
BUNDLE_IMAGE: openstack-operator-bundle
INDEX_IMAGE_TAG: latest
INDEX_IMAGE: openstack-operator-index

0 comments on commit f609375

Please sign in to comment.