Skip to content

Build Base

Build Base #491

name: Build Base
on:
workflow_dispatch:
schedule:
- cron: "20 19 * * *"
jobs:
build-amd64:
strategy:
fail-fast: false
matrix:
branch: [master, release-1.11, release-1.9]
name: Build AMD64
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
ref: ${{ matrix.branch }}
- uses: docker/setup-buildx-action@v2
- name: Build
run: |
make base-amd64
make base-tar-amd64
- name: Upload image to artifact
uses: actions/upload-artifact@v3
with:
name: image-amd64-${{ matrix.branch }}
path: image-amd64.tar
build-arm64:
strategy:
fail-fast: false
matrix:
branch: [master, release-1.11, release-1.9]
name: Build ARM64
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
ref: ${{ matrix.branch }}
- uses: docker/setup-buildx-action@v2
- uses: docker/setup-qemu-action@v2
with:
platforms: arm64
- name: Build
run: |
make base-arm64 || make base-arm64
make base-tar-arm64
- name: Upload image to artifact
uses: actions/upload-artifact@v3
with:
name: image-arm64-${{ matrix.branch }}
path: image-arm64.tar
push:
strategy:
fail-fast: false
matrix:
branch: [master, release-1.11, release-1.9]
needs:
- build-arm64
- build-amd64
name: push
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
ref: ${{ matrix.branch }}
- name: Download image
uses: actions/download-artifact@v3
with:
name: image-amd64-${{ matrix.branch }}
- name: Download image
uses: actions/download-artifact@v3
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