forked from openstack-k8s-operators/openstack-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (53 loc) · 1.83 KB
/
pr.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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: Log in to Red Hat Registry
uses: redhat-actions/podman-login@v1
with:
registry: ${{ env.imageregistry }}
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Create index image
shell: bash
run: |
pushd "${GITHUB_WORKSPACE}"
git status
git diff
CATALOG_EXTRA_BUNDLES=""
CATALOG_EXTRA_BUNDLES=$(/bin/bash ./hack/pin-bundle-images.sh)
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