feat(domain): add option to set controller domain (#52) #57
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@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: "go.mod" | |
- name: Start kind cluster | |
uses: helm/kind-action@v1 | |
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@v4 | |
# For multi-arch docker builds | |
# https://github.com/docker/setup-qemu-action | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
# https://github.com/docker/setup-buildx-action | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
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@v4 | |
id: semantic # The `id` for output variables | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build multi-platform images | |
uses: docker/build-push-action@v6 | |
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 }} |