Skip to content

Build Base

Build Base #1044

name: Build Base
on:
workflow_dispatch:
schedule:
- cron: "20 19 * * *"
jobs:
build-amd64:
strategy:
fail-fast: false
matrix:
branch: [skip_local_dns_ip_conntrack_1.12]
name: Build AMD64
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- uses: docker/setup-buildx-action@v3
- uses: actions/setup-go@v5
if: (github.event.inputs.branch || matrix.branch) == matrix.branch
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-${{ matrix.branch }}
path: image-amd64.tar
build-arm64:
strategy:
fail-fast: false
matrix:
branch: [skip_local_dns_ip_conntrack_1.12]
name: Build ARM64
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- uses: docker/setup-buildx-action@v3
- uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- uses: actions/setup-go@v5
if: (github.event.inputs.branch || matrix.branch) == matrix.branch
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-arm64 || make base-arm64
make base-tar-arm64
- name: Upload image to artifact
uses: actions/upload-artifact@v4
with:
name: image-arm64-${{ matrix.branch }}
path: image-arm64.tar
push:
strategy:
fail-fast: false
matrix:
branch: [skip_local_dns_ip_conntrack_1.12]
needs:
- build-arm64
- build-amd64
name: push
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- name: Download image
uses: actions/download-artifact@v4
with:
name: image-amd64-${{ matrix.branch }}
- name: Download image
uses: actions/download-artifact@v4
with:
name: image-arm64-${{ matrix.branch }}
- name: Load Image
run: |
docker load --input image-amd64.tar
docker load --input image-arm64.tar
- name: Push
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
COMMIT: ${{ github.sha }}
run: |
cat VERSION
TAG=$(cat VERSION)
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker images
docker push kubeovn/kube-ovn-base:$TAG-amd64
docker push kubeovn/kube-ovn-base:$TAG-arm64
docker manifest create kubeovn/kube-ovn-base:$TAG kubeovn/kube-ovn-base:$TAG-amd64 kubeovn/kube-ovn-base:$TAG-arm64
docker manifest push kubeovn/kube-ovn-base:$TAG
if [ "${{ matrix.branch }}" == "master" || "${{ matrix.branch }}" == "release-1.11" ]; then
docker push kubeovn/kube-ovn-base:$TAG-debug-amd64
docker push kubeovn/kube-ovn-base:$TAG-debug-arm64
docker manifest create kubeovn/kube-ovn-base:$TAG-debug kubeovn/kube-ovn-base:$TAG-debug-amd64 kubeovn/kube-ovn-base:$TAG-debug-arm64
docker manifest push kubeovn/kube-ovn-base:$TAG-debug
fi