Skip to content

Commit

Permalink
ci: build arm64 base images on arm64 hosted runners (#4936)
Browse files Browse the repository at this point in the history
Signed-off-by: zhangzujian <[email protected]>
  • Loading branch information
zhangzujian committed Jan 17, 2025
1 parent a8fde89 commit 60f3dcb
Showing 1 changed file with 14 additions and 40 deletions.
54 changes: 14 additions & 40 deletions .github/workflows/build-kube-ovn-base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,18 @@ name: Build Base
on: workflow_dispatch

jobs:
build-amd64:
name: Build AMD64
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3

- uses: actions/setup-go@v5
id: setup-go
with:
go-version-file: go.mod
check-latest: true
cache: false

- name: Build
env:
GO_VERSION: ${{ steps.setup-go.outputs.go-version }}
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db:2
run: |
make base-amd64
make base-tar-amd64
- name: Upload image to artifact
uses: actions/upload-artifact@v4
with:
name: image-amd64
path: image-amd64.tar

build-arm64:
name: Build ARM64
runs-on: ubuntu-22.04
build:
strategy:
fail-fast: false
matrix:
arch:
- amd64
- arm64
name: Build
runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-22.04-arm' || 'ubuntu-22.04' }}
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/setup-qemu-action@v3
with:
platforms: arm64

- uses: actions/setup-go@v5
id: setup-go
Expand All @@ -52,19 +27,18 @@ jobs:
GO_VERSION: ${{ steps.setup-go.outputs.go-version }}
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db:2
run: |
make base-arm64 || make base-arm64
make base-tar-arm64
make base-${{ matrix.arch }}
make base-tar-${{ matrix.arch }}
- name: Upload image to artifact
uses: actions/upload-artifact@v4
with:
name: image-arm64
path: image-arm64.tar
name: image-${{ matrix.arch }}
path: image-${{ matrix.arch }}.tar

push:
needs:
- build-arm64
- build-amd64
- build
name: push
runs-on: ubuntu-22.04
steps:
Expand Down

0 comments on commit 60f3dcb

Please sign in to comment.