Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(main): add arm64 platform support #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 15 additions & 57 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
- 'master'
tags:
- "[0-9].[0-9]+.[0-9]+*"
pull_request:
branches:
- 'master'

env:
CONTAINER_LABELS: |
Expand All @@ -19,7 +16,7 @@ env:
org.opencontainers.image.title=Linkedin's Cruise Control for Koperator
org.opencontainers.image.description=Linkedin's Cruise Control container image built for Koperator (https://github.com/banzaicloud/koperator)
org.opencontainers.image.vendor=Cisco Systems
PLATFORMS: linux/amd64
PLATFORMS: linux/amd64,linux/arm64

jobs:
build:
Expand All @@ -44,80 +41,41 @@ jobs:

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
flavor: |
latest=false
images: |
ghcr.io/banzaicloud/cruise-control
tags: |
type=sha,enable=true,format=short,prefix=
labels: ${{ env.CONTAINER_LABELS }}

- name: Build Cruise Control container image
uses: docker/build-push-action@v4
with:
build-args: |
CRUISE_CONTROL_VERSION=${{ steps.version.outputs.version }}
CRUISE_CONTROL_UI_GIT_REF=${{ steps.ui-version.outputs.version }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ env.PLATFORMS }}
push: false
load: true
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Run tests
run: make test
env:
CI: true
CRUISE_CONTROL_IMAGE: ${{ steps.meta.outputs.tags }}
READINESS_TIMEOUT: 3600

publish:
if: ${{ github.event_name != 'pull_request' }}
needs: build
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
flavor: |
latest=auto
images: |
ghcr.io/banzaicloud/cruise-control
ghcr.io/${{ github.repository_owner }}/cruise-control
tags: |
type=semver,pattern={{version}}
type=ref,event=tag
type=edge,branch=master
type=raw,value=latest,enable=true
labels: ${{ env.CONTAINER_LABELS }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}

- name: Publish Cruise Control container image
- name: Build Cruise Control container image
uses: docker/build-push-action@v4
with:
build-args: |
CRUISE_CONTROL_VERSION=${{ needs.build.outputs.cruise_control_version }}
CRUISE_CONTROL_UI_GIT_REF=${{ needs.build.outputs.cruise_control_ui_version }}
CRUISE_CONTROL_VERSION=${{ steps.version.outputs.version }}
CRUISE_CONTROL_UI_GIT_REF=${{ steps.ui-version.outputs.version }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ env.PLATFORMS }}
push: ${{ github.event_name != 'pull_request' }}
file: Dockerfile
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Run tests
run: make test
env:
CI: true
CRUISE_CONTROL_IMAGE: ghcr.io/${{ github.repository_owner }}/cruise-control:latest
READINESS_TIMEOUT: 3600