Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(build): Add a CI workflow to build and push multiubuntu image whenever a change detected #1878

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
45 changes: 45 additions & 0 deletions .github/workflows/ci-build-and-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: ci-build-and-push
sikehish marked this conversation as resolved.
Show resolved Hide resolved

on:
push:
branches:
- main
pull_request:
sikehish marked this conversation as resolved.
Show resolved Hide resolved
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

sikehish marked this conversation as resolved.
Show resolved Hide resolved
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: true

- name: Set up QEMU for multi-architecture builds
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
platforms: linux/amd64,linux/arm64/v8

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_AUTHTOK }}

- name: Build and push multi-architecture image
uses: docker/build-push-action@v6
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

examples/multiubuntu/build/build.sh can handle build and push as well, no need to setup docker action for it.
build and push

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need multiarch builds, they are not handled in the script.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my bad, in that case keep repo name same that used in the script

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

examples/multiubuntu/build/build.sh can handle build and push as well, no need to setup docker action for it. build and push

Do I need to make any changes? Do I need to use examples/multiubuntu/build/build.sh? A bit confused here. Would love for some clarity :))

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sikehish no need to use build.sh script, changes with your PR looks good just change image tag kubearmor/ubuntu-w-utils:latest

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @rksharma95 . Ive made the change. Let me know if you need me to change anything else :)

with:
context: examples/multiubuntu/build
file: examples/multiubuntu/build/Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/multiubuntu:latest
platforms: linux/amd64,linux/arm64/v8

- name: Logout from Docker Hub
run: docker logout