This repository has been archived by the owner on Sep 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
57 lines (49 loc) · 1.78 KB
/
image.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
name: Image
on:
push:
branches:
- main
- v[0-9]+.[0-9]+
jobs:
build:
name: Image build and push
runs-on: ubuntu-latest
steps:
- name: Set Up Environment Variables
env:
REPO: quay.io/${{ secrets.QUAY_ACCOUNT_NAME }}
IMG: gatekeeper-operator
run: |
echo "REPO=${REPO}" >> ${GITHUB_ENV}
WORKFLOW_IMG="${REPO}/${IMG}"
echo "WORKFLOW_IMG=${WORKFLOW_IMG}" >> ${GITHUB_ENV}
echo "WORKFLOW_BUNDLE_IMG=${WORKFLOW_IMG}-bundle" >> ${GITHUB_ENV}
echo "WORKFLOW_BUNDLE_INDEX_IMG=${WORKFLOW_IMG}-bundle-index" >> ${GITHUB_ENV}
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for all tags and branches
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
with:
driver-opts: image=moby/buildkit:v0.8-beta
- uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}
- name: Set Up Go to Install OPM
uses: actions/setup-go@v3
with:
go-version-file: go.mod
- name: Build and Push Operator Image
run: |
make docker-build VERSION=main IMG=${WORKFLOW_IMG}:main
make docker-push IMG=${WORKFLOW_IMG}:main
- name: Build and Push Bundle Image
run: |
make bundle-build VERSION=main IMG=${WORKFLOW_IMG}:main BUNDLE_IMG=${WORKFLOW_BUNDLE_IMG}:main
make docker-push IMG=${WORKFLOW_BUNDLE_IMG}:main
- name: Build and Push Bundle Index Image
run: |
make bundle-index-build VERSION=main IMG=${WORKFLOW_IMG}:main BUNDLE_IMG=${WORKFLOW_BUNDLE_IMG}:main BUNDLE_INDEX_IMG=${WORKFLOW_BUNDLE_INDEX_IMG}:main
make docker-push IMG=${WORKFLOW_BUNDLE_INDEX_IMG}:main