Skip to content

Build Base

Build Base #486

name: Build Base
on: workflow_dispatch
jobs:
build-amd64:
name: Build AMD64
runs-on: ubuntu-22.04
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Docker Buildx
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@v2
with:
name: image-amd64
path: image-amd64.tar
build-arm64:
name: Build ARM64
runs-on: ubuntu-22.04
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
image: tonistiigi/binfmt:qemu-v5.2.0
platforms: arm64
- name: Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build
run: |
make base-arm64 || make base-arm64
make base-tar-arm64
- name: Upload image to artifact
uses: actions/upload-artifact@v2
with:
name: image-arm64
path: image-arm64.tar
push:
needs:
- build-arm64
- build-amd64
name: push
runs-on: ubuntu-22.04
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Download image
uses: actions/download-artifact@v2
with:
name: image-amd64
- name: Download image
uses: actions/download-artifact@v2
with:
name: image-arm64
- 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