Merge pull request #3820 from jcaamano/localnet-node-watch #51
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ovn-docker-images | |
on: | |
push: | |
branches: [ master ] | |
permissions: | |
contents: read | |
packages: write | |
env: | |
GO_VERSION: 1.19.6 | |
REGISTRY: ghcr.io | |
OWNER: ovn-org | |
REPOSITORY: ovn-kubernetes | |
FEDORA_IMAGE_NAME: ovn-kube-f | |
UBUNTU_IMAGE_NAME: ovn-kube-u | |
jobs: | |
build: | |
name: Build Images | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
id: go | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v3 | |
- name: Log in to the GH Container registry | |
uses: docker/[email protected] | |
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@master | |
with: | |
platforms: all | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@master | |
- name: Extract metadata (tags, labels) for fedora ovn-k image | |
id: meta-fedora | |
uses: docker/[email protected] | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPOSITORY }}/${{ env.FEDORA_IMAGE_NAME }} | |
- name: Build and push Fedora based Docker image | |
uses: docker/[email protected] | |
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/[email protected] | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPOSITORY }}/${{ env.UBUNTU_IMAGE_NAME }} | |
- name: Build and push Ubuntu based Docker image | |
uses: docker/[email protected] | |
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 }} |