forked from opendatahub-io/opendatahub-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathci-build-push-catalog-latest.yaml
More file actions
94 lines (81 loc) · 3.23 KB
/
ci-build-push-catalog-latest.yaml
File metadata and controls
94 lines (81 loc) · 3.23 KB
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
87
88
89
90
91
92
93
94
name: Build and push catalog image for main branch
on:
push:
branches:
- main
paths:
- 'config/**'
- 'Dockerfiles/**'
- 'internal/**'
- 'pkg/**'
- 'cmd/main.go'
workflow_dispatch: # Allow manual triggering
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: {}
env:
IMAGE_TAG_BASE: quay.io/${{ secrets.QUAY_ORG }}/opendatahub-operator
jobs:
create-catalog-image:
name: Build/push catalog image
runs-on: ubuntu-latest
env:
IMAGE_BUILDER: podman
steps:
- name: Checkout
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
- name: Quay.io login
uses: redhat-actions/podman-login@4934294ad0449894bcd1e9f191899d7292469603 # v1.7
with:
registry: quay.io
username: ${{ secrets.QUAY_ID }}
password: ${{ secrets.QUAY_TOKEN }}
- name: Setup Go
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version-file: go.mod
- name: Get short SHA
id: short-sha
run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Get VERSION from Makefile
id: version
run: |
base_version=$(make -s print-VERSION)
echo "full=${base_version}-main-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
# We need BUNDLE_IMG tag to be a SemVer compliant because it is used
# by https://github.com/davidebianchi/opendatahub-operator/blob/main/hack/update-catalog-template.sh
# to set the OLM bundle version in the catalog (the latest catalog reference the last VERSION-snapshot bundle, which reference to latest opendatahub-operator tag).
# We choose snapshot for the bundle image tag to avoid to have a VERSION-latest bundle tag,
# which could be misleading (e.g. v3.2.0-latest with v3.2.0 released).
echo "snapshot=${base_version}-snapshot" >> $GITHUB_OUTPUT
- name: Create bundle image (snapshot)
env:
BUNDLE_IMG: ${{ env.IMAGE_TAG_BASE }}-bundle:v${{ steps.version.outputs.snapshot }}
IMG_TAG: latest
VERSION: ${{ steps.version.outputs.snapshot }}
run: |
make bundle-build
make bundle-push
- name: Build and push catalog image (latest)
env:
CATALOG_IMG: ${{ env.IMAGE_TAG_BASE }}-catalog:latest
BUNDLE_IMG: ${{ env.IMAGE_TAG_BASE }}-bundle:v${{ steps.version.outputs.snapshot }}
run: |
make catalog-build
make catalog-push
- name: Create bundle image (main-sha)
env:
BUNDLE_IMG: ${{ env.IMAGE_TAG_BASE }}-bundle:v${{ steps.version.outputs.full }}
IMG_TAG: main-${{ steps.short-sha.outputs.sha }}
VERSION: ${{ steps.version.outputs.full }}
run: |
make bundle-build
make bundle-push
- name: Build and push catalog image (main-sha)
env:
CATALOG_IMG: ${{ env.IMAGE_TAG_BASE }}-catalog:main-${{ steps.short-sha.outputs.sha }}
BUNDLE_IMG: ${{ env.IMAGE_TAG_BASE }}-bundle:v${{ steps.version.outputs.full }}
run: |
make catalog-build
make catalog-push