Skip to content

Fix promxy-operator build #2

Fix promxy-operator build

Fix promxy-operator build #2

name: promxy-operator-release
on:
push:
tags:
- "*"
branches:
- main
env:
GO_VERSION: "1.22"
jobs:
build:
concurrency:
group: build-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
name: Build and Unit Test
runs-on: ubuntu-latest
outputs:
version: ${{ steps.vars.outputs.version }}
permissions:
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- name: Unit tests
working-directory: ./promxy-operator
run: |
make test
- name: Set up Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get outputs
id: vars
run: |
GIT_VERSION=$(git describe --tags --always)
echo "version=${GIT_VERSION}" >> $GITHUB_OUTPUT
- name: Build and push
uses: docker/build-push-action@v6
if: github.repository == 'k0rdent/kof'
with:
build-args: |
LD_FLAGS=-s -w
context: "{{defaultContext}}:promxy-operator"
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/k0rdent/kof/promxy-operator-controller:${{ steps.vars.outputs.version }}
push: true
cache-from: type=gha
cache-to: type=gha,mode=max