-
Notifications
You must be signed in to change notification settings - Fork 8
55 lines (52 loc) · 1.31 KB
/
controller-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
name: Build and push controller
on:
push:
branches:
- main
- v1.0.1
paths:
- .github/workflows/**
- controllers/**
- api/**
- ./main.go
- ./go.mod
- config/**
- ./Dockerfile
- ./bundle.Dockerfile
- ./Makefile
env:
IMAGE_VERSION: '1.0.1'
jobs:
build-push-controller:
if: ${{ github.repository_owner == 'IBM' }}
runs-on: ubuntu-latest
env:
IMAGE_NAME: ghcr.io/ibm/cpe-operator/controller
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.17.0'
- name: Tidy
run: |
go mod tidy
make generate fmt vet
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_TOKEN }}
- name: Build and push controller
uses: docker/build-push-action@v2
with:
context: .
push: true
platforms: linux/amd64,linux/arm64,linux/s390x
tags: |
${{ env.IMAGE_NAME }}:v${{ env.IMAGE_VERSION }}
file: ./Dockerfile