Skip to content

Commit f035954

Browse files
committed
Split out github actions for operator bundle and image releases
Signed-off-by: Anish Asthana <anishasthana1@gmail.com>
1 parent 0c70207 commit f035954

File tree

2 files changed

+63
-7
lines changed

2 files changed

+63
-7
lines changed
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
# This workflow will build images for the codeflare-operator, then push the images to the `project-codeflare` quay repo
1+
# This workflow will build the CodeFlare Operator bundle and push it to the project-codeflare image registry
22

33
name: Image
44

55
on:
6+
workflow_dispatch:
67
push:
78
tags:
89
- "*"
@@ -41,21 +42,17 @@ jobs:
4142
password: ${{ secrets.RH_REG_TOKEN }}
4243
registry: registry.redhat.io
4344

44-
- name: Image Build
45+
- name: Bundle Image Build
4546
run: |
4647
make build
4748
make bundle
48-
make image-build -e IMG=quay.io/project-codeflare/codeflare-operator:${SOURCE_TAG}
49-
podman tag quay.io/project-codeflare/codeflare-operator:${SOURCE_TAG} quay.io/project-codeflare/codeflare-operator:latest
5049
make bundle-build -e BUNDLE_IMG=quay.io/project-codeflare/codeflare-operator-bundle:${SOURCE_TAG}
5150
podman tag quay.io/project-codeflare/codeflare-operator-bundle:${SOURCE_TAG} quay.io/project-codeflare/codeflare-operator-bundle:latest
5251
env:
5352
SOURCE_TAG: ${{ steps.tag_name.outputs.SOURCE_TAG }}
5453

55-
- name: Image Push
54+
- name: Bundle Push
5655
run: |
57-
make image-push -e IMG=quay.io/project-codeflare/codeflare-operator:${SOURCE_TAG}
58-
make image-push -e IMG=quay.io/project-codeflare/codeflare-operator:latest
5956
make bundle-push -e BUNDLE_IMG=quay.io/project-codeflare/codeflare-operator-bundle:${SOURCE_TAG}
6057
make bundle-push -e BUNDLE_IMG=quay.io/project-codeflare/codeflare-operator-bundle:latest
6158
env:
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# This workflow will build the CodeFlare Operator image and push it to the project-codeflare image registry
2+
3+
name: Image
4+
5+
on:
6+
workflow_dispatch:
7+
push:
8+
tags:
9+
- "*"
10+
11+
jobs:
12+
push:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- name: Install operator-sdk
18+
run: |
19+
export ARCH=$(case $(uname -m) in x86_64) echo -n amd64 ;; aarch64) echo -n arm64 ;; *) echo -n $(uname -m) ;; esac)
20+
export OS=$(uname | awk '{print tolower($0)}')
21+
export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.27.0
22+
curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH}
23+
chmod +x operator-sdk_${OS}_${ARCH} && sudo mv operator-sdk_${OS}_${ARCH} /usr/local/bin/operator-sdk
24+
25+
26+
- name: Grab New Version Tag
27+
id: tag_name
28+
run: |
29+
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
30+
31+
- name: Login to Quay.io
32+
uses: redhat-actions/podman-login@v1
33+
with:
34+
username: ${{ secrets.QUAY_ID }}
35+
password: ${{ secrets.QUAY_TOKEN }}
36+
registry: quay.io
37+
38+
- name: Login to Red Hat Registry
39+
uses: redhat-actions/podman-login@v1
40+
with:
41+
username: ${{ secrets.RH_REG_ID }}
42+
password: ${{ secrets.RH_REG_TOKEN }}
43+
registry: registry.redhat.io
44+
45+
- name: Image Build
46+
run: |
47+
make build
48+
make bundle
49+
make image-build -e IMG=quay.io/project-codeflare/codeflare-operator:${SOURCE_TAG}
50+
podman tag quay.io/project-codeflare/codeflare-operator:${SOURCE_TAG} quay.io/project-codeflare/codeflare-operator:latest
51+
env:
52+
SOURCE_TAG: ${{ steps.tag_name.outputs.SOURCE_TAG }}
53+
54+
- name: Image Push
55+
run: |
56+
make image-push -e IMG=quay.io/project-codeflare/codeflare-operator:${SOURCE_TAG}
57+
make image-push -e IMG=quay.io/project-codeflare/codeflare-operator:latest
58+
env:
59+
SOURCE_TAG: ${{ steps.tag_name.outputs.SOURCE_TAG }}

0 commit comments

Comments
 (0)