Skip to content

Merge pull request #4745 from kyrtapz/udn_allowed_arg_verify #36

Merge pull request #4745 from kyrtapz/udn_allowed_arg_verify

Merge pull request #4745 from kyrtapz/udn_allowed_arg_verify #36

Workflow file for this run

name: ovn-docker-images
on:
push:
branches: [ master,release-1.0 ]
permissions:
contents: read
packages: write
env:
GO_VERSION: 1.22.0
REGISTRY: ghcr.io
OWNER: ovn-org
REPOSITORY: ovn-kubernetes
FEDORA_IMAGE_NAME: ovn-kube-fedora
UBUNTU_IMAGE_NAME: ovn-kube-ubuntu
jobs:
build:
name: Build Images
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: "**/*.sum"
id: go
- name: Log in to the GH Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up environment
run: |
export GOPATH=$(go env GOPATH)
echo "GOPATH=$GOPATH" >> $GITHUB_ENV
echo "$GOPATH/bin" >> $GITHUB_PATH
- name: Build ovnkube-binaries copy to context
run: |
pushd go-controller
make
popd
pushd dist/images
cp -r ../../go-controller/_output/go/bin/* .
popd
- name: Generate git-info to write to image
run: |
BRANCH=$(git rev-parse --short "$GITHUB_SHA")
COMMIT=$(git rev-parse HEAD)
pushd dist/images
echo "ref: ${BRANCH} commit: ${COMMIT}" > git_info
popd
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Extract metadata (tags, labels) for fedora ovn-k image
id: meta-fedora
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPOSITORY }}/${{ env.FEDORA_IMAGE_NAME }}
- name: Build and push Fedora based Docker image
uses: docker/build-push-action@v5
with:
builder: ${{ steps.buildx.outputs.name }}
context: ./dist/images
file: ./dist/images/Dockerfile.fedora
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta-fedora.outputs.tags }}
labels: ${{ steps.meta-fedora.outputs.labels }}
- name: Extract metadata (tags, labels) for ubuntu ovn-k image
id: meta-ubuntu
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPOSITORY }}/${{ env.UBUNTU_IMAGE_NAME }}
- name: Build and push Ubuntu based Docker image
uses: docker/build-push-action@v5
with:
builder: ${{ steps.buildx.outputs.name }}
context: ./dist/images
file: ./dist/images/Dockerfile.ubuntu
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta-ubuntu.outputs.tags }}
labels: ${{ steps.meta-ubuntu.outputs.labels }}