Skip to content

Commit

Permalink
Create GitHub workflows to build luigi and openvswitch image
Browse files Browse the repository at this point in the history
  • Loading branch information
shweta50 committed Sep 18, 2024
1 parent 7ec0b8c commit 230682a
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 2 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/luigi-build-and-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: docker
on:
push:
branches:
- 'master'
- 'v*'
- 'private/**'

jobs:
buildx:
env:
USERNAME: ${{ secrets.QUAY_USERNAME }}
PASSWORD: ${{ secrets.QUAY_PASSWORD }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Docker BuildX
uses: docker/setup-buildx-action@v1

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

# setup Docker buld action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to the Docker Registry
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ env.USERNAME }}
password: ${{ env.PASSWORD }}

- name: Build/Push image to Quay Container Registry
run:
TEAMCITY_BUILD_ID=${{ github.run_number }}
make img-build-push
53 changes: 53 additions & 0 deletions .github/workflows/ovs-build-and-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
name: docker
on:
push:
branches:
- 'master'
- 'v*'
- 'private/**'
paths:
- hostplumber/**

jobs:
buildx:
env:
USERNAME: ${{ secrets.QUAY_USERNAME }}
PASSWORD: ${{ secrets.QUAY_PASSWORD }}
BUILD_ARGS: ""
PLATFORMS: linux/amd64
BRANCH: ${{ github.head_ref || github.ref_name }}
PUSH: true
runs-on: ubuntu-latest
steps:
- name: Set env
run:
echo "TAG=$(echo "${{ env.BRANCH }}" | tr -d /)" >> $GITHUB_ENV

- uses: actions/checkout@v3

- name: Setup Docker BuildX
uses: docker/setup-buildx-action@v1

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

# setup Docker buld action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to the Quay Registry
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ env.USERNAME }}
password: ${{ env.PASSWORD }}

- name: Build/Push image to Quay Container Registry
uses: docker/build-push-action@v3
with:
context: hostplumber/pkg/ovs-docker
tags: quay.io/platform9/openvswitch:${{ env.TAG }}-{{ github.run_number }}
push: ${{ env.PUSH }}
build-args: ${{ env.BUILD_ARGS}}
platforms: ${{ env.PLATFORMS }}
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ SHELL=/bin/bash
# Image URL to use all building/pushing image targets
#IMG ?= controller:latest
VER_LABEL=$(shell ./get-label.bash)
IMG ?= platform9/luigi-plugins:$(VER_LABEL)
IMG ?= quay.io/platform9/luigi-plugins:$(VER_LABEL)
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.27

Expand Down Expand Up @@ -154,7 +154,6 @@ img-build: $(BUILD_DIR) img-test
echo ${IMG} > $(BUILD_DIR)/container-tag

img-build-push: img-build
docker login
docker push ${IMG}
echo ${IMG} > $(BUILD_DIR)/container-tag

Expand Down

0 comments on commit 230682a

Please sign in to comment.