Skip to content

Commit bc443bb

Browse files
Bobbins228ChristianZaccaria
authored andcommitted
CARRY: Added automated workflow for pushing opendatahub/codeflare-operator image
1 parent 6565ce0 commit bc443bb

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# This workflow will build the CodeFlare Operator image and push it to the opendatahub image registry
2+
3+
name: Build and Push
4+
5+
on:
6+
pull_request:
7+
types:
8+
- closed
9+
workflow_dispatch:
10+
11+
jobs:
12+
build-and-push:
13+
if: (github.event.pull_request.merged == true && github.event.pull_request.user.login == 'codeflare-machine-account' && contains(github.event.pull_request.title, 'Sync with Upstream')) || github.event_name == 'workflow_dispatch'
14+
name: Build and push ODH/CFO image
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: Set Go
20+
uses: actions/setup-go@v3
21+
with:
22+
go-version: v1.20
23+
24+
- name: Login to Quay.io
25+
uses: redhat-actions/podman-login@v1
26+
with:
27+
username: ${{ secrets.QUAY_BOT_USER }}
28+
password: ${{ secrets.QUAY_BOT_PASSWORD }}
29+
registry: quay.io
30+
31+
- name: Get Upstream Release Tags
32+
id: release-tags
33+
run: |
34+
release_tag=$(gh release view -R github.com/project-codeflare/codeflare-operator --json tagName | jq -r '.tagName')
35+
echo "RELEASE_TAG=$release_tag" >> $GITHUB_ENV
36+
env:
37+
GITHUB_TOKEN: ${{ github.token }}
38+
39+
- name: Cleanup the go.mod and go.sum
40+
run: |
41+
go mod tidy
42+
43+
- name: Image Build and Push
44+
run: |
45+
make build
46+
make image-build -e IMG=quay.io/opendatahub/codeflare-operator:${{ env.RELEASE_TAG }}
47+
make image-push -e IMG=quay.io/opendatahub/codeflare-operator:${{ env.RELEASE_TAG }}
48+
49+
- name: Delete remote branch
50+
run: |
51+
git push origin --delete sync-cfo-fork

0 commit comments

Comments
 (0)