-
Notifications
You must be signed in to change notification settings - Fork 21
53 lines (50 loc) · 1.53 KB
/
build-image-main.yml
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
name: Main controller image build and tag
on:
push:
branches:
- 'main'
env:
QUAY_ORG: opendatahub
QUAY_IMG_REPO: model-registry-operator
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }}
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}
PUSH_IMAGE: true
jobs:
build-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate Tag
shell: bash
id: tags
run: |
commit_sha=${{ github.event.after }}
tag=main-${commit_sha:0:7}
echo "tag=${tag}" >> $GITHUB_OUTPUT
- name: Build and Push Image
shell: bash
env:
VERSION: ${{ steps.tags.outputs.tag }}
run: ./scripts/build_deploy.sh
- name: Tag Latest
shell: bash
env:
IMG: quay.io/${{ env.QUAY_ORG }}/${{ env.QUAY_IMG_REPO }}
BUILD_IMAGE: false
NEWEST_TAG: ${{ steps.tags.outputs.tag }}
VERSION: latest
run: |
docker tag ${{ env.IMG }}:${{ env.NEWEST_TAG }} ${{ env.IMG }}:${{ env.VERSION }}
# BUILD_IMAGE=false skip the build
./scripts/build_deploy.sh
- name: Tag Main
shell: bash
env:
IMG: quay.io/${{ env.QUAY_ORG }}/${{ env.QUAY_IMG_REPO }}
BUILD_IMAGE: false
NEWEST_TAG: ${{ steps.tags.outputs.tag }}
VERSION: main
run: |
docker tag ${{ env.IMG }}:${{ env.NEWEST_TAG }} ${{ env.IMG }}:${{ env.VERSION }}
# BUILD_IMAGE=false skip the build
./scripts/build_deploy.sh