Skip to content

Merge pull request #23 from sunya-ch/v1.0.1 #12

Merge pull request #23 from sunya-ch/v1.0.1

Merge pull request #23 from sunya-ch/v1.0.1 #12

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