-
Notifications
You must be signed in to change notification settings - Fork 1
86 lines (77 loc) · 2.79 KB
/
image-build.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Multiple Architecture Image Build
on:
workflow_dispatch:
push:
branches:
- "main"
- "release-*"
tags:
- "v*"
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
jobs:
prepare:
runs-on: ubuntu-latest
steps:
- name: Extract tag
id: extract_tag
run: |
tag=$(if [[ ${{github.ref_name}} == v* ]];then echo "${{github.ref_name}}"; else echo "latest"; fi)
echo "tag=$tag" >> $GITHUB_OUTPUT
outputs:
tag: ${{ steps.extract_tag.outputs.tag }}
operator-build:
uses: trustification/release-tools/.github/workflows/build-push-images.yaml@main
with:
registry: "ghcr.io"
image_name: "${{ github.repository_owner }}/trustify-operator"
containerfile: "./Dockerfile"
architectures: '[ "amd64" ]'
secrets:
registry_username: ${{ github.actor }}
registry_password: ${{ secrets.GITHUB_TOKEN }}
bundle-build:
uses: trustification/release-tools/.github/workflows/build-push-images.yaml@main
needs:
- prepare
- operator-build
with:
registry: "ghcr.io"
image_name: "${{ github.repository_owner }}/trustify-operator-bundle"
containerfile: "./bundle.Dockerfile"
architectures: '[ "amd64" ]'
extra-args: '--build-arg QUARKUS_OPTS="-Dquarkus.container-image.image=ghcr.io/${{ github.repository_owner }}/trustify-operator:${{ needs.prepare.outputs.tag }}"'
secrets:
registry_username: ${{ github.actor }}
registry_password: ${{ secrets.GITHUB_TOKEN }}
catalog-build:
runs-on: ubuntu-latest
needs:
- prepare
- bundle-build
steps:
- name: Setup OLM CLIs
run: |
export ARCH=$(case $(uname -m) in x86_64) echo -n amd64 ;; aarch64) echo -n arm64 ;; *) echo -n $(uname -m) ;; esac)
export OS=$(uname | awk '{print tolower($0)}')
# Opm
export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-registry/releases/download/v1.45.0
curl -LO ${OPERATOR_SDK_DL_URL}/${OS}-${ARCH}-opm
chmod +x ${OS}-${ARCH}-opm && sudo mv ${OS}-${ARCH}-opm /usr/local/bin/opm
- name: Create catalog
run: |
opm index add \
--bundles ghcr.io/${{ github.repository_owner }}/trustify-operator-bundle:$TAG \
--tag ${{ github.repository_owner }}/trustify-operator-catalog:$TAG \
--build-tool podman
env:
TAG: ${{ needs.prepare.outputs.tag }}
- name: Push To Registry
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ github.repository_owner }}/trustify-operator-catalog
tags: ${{ needs.prepare.outputs.tag }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: "ghcr.io"