feat(operator-sdk): Upgrade to operator-sdk v1.37 (#36) #53
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and push | |
on: | |
push: | |
branches: [main] | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: checkly/checkly-operator | |
USE_EXISTING_CLUSTER: true | |
GO_MODULES: on | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out source code | |
uses: actions/checkout@v1 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: "go.mod" | |
- name: Start kind cluster | |
uses: helm/[email protected] | |
with: | |
version: "v0.22.0" # This starts k8s v1.29 | |
- name: Test code | |
env: | |
USE_EXISTING_CLUSTER: true | |
run: | | |
make test-ci | |
# Sonarcloud | |
# - name: SonarCloud Scan | |
# uses: SonarSource/sonarcloud-github-action@master | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
# GO_MODULES: "on" | |
# Docker buildx does not allow for multi architecture builds and loading the docker container locally, | |
# this way we can not run trivy against the containers, one solution is to run multiple jobs for each arch | |
docker: | |
name: Docker build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out source code | |
uses: actions/checkout@v1 | |
# For multi-arch docker builds | |
# https://github.com/docker/setup-qemu-action | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
# https://github.com/docker/setup-buildx-action | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Log in to the Container registry | |
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: NPM Install packages for semantic-release | |
run: | | |
npm install | |
- name: Release | |
uses: cycjimmy/semantic-release-action@v3 | |
id: semantic # The `id` for output variables | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build multi-platform images | |
uses: docker/build-push-action@v2 | |
if: ${{ steps.semantic.outputs.new_release_version }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
IMAGE: ${{ env.REGISTRY }}/${{env.IMAGE_NAME}}:${{ steps.semantic.outputs.new_release_version }} | |
with: | |
context: . | |
platforms: linux/amd64, linux/arm, linux/arm64 | |
push: true | |
tags: ${{ env.IMAGE }} |