-
Notifications
You must be signed in to change notification settings - Fork 350
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
base: main
Are you sure you want to change the base?
chore(build): Add a CI workflow to build and push multiubuntu image whenever a change detected #1878
Changes from 11 commits
0129ca1
317dd20
033e318
99a0838
fd5ac14
8c96ba2
33d96c2
649a416
4b4c8a7
2501d77
cb94259
1b3cdb9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: ci-build-and-push-ubuntu | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
if: github.repository == 'kubearmor/kubearmor' | ||
runs-on: ubuntu-latest | ||
|
||
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 | ||
with: | ||
context: examples/multiubuntu/build | ||
file: examples/multiubuntu/build/Dockerfile | ||
push: true | ||
tags: kubearmor/ubuntu-w-utils:latest | ||
platforms: linux/amd64,linux/arm64/v8 | ||
|
||
- name: Logout from Docker Hub | ||
run: docker logout |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ on: | |
- ".github/workflows/ci-test-ginkgo.yml" | ||
- "pkg/KubeArmorOperator/**" | ||
- "deployments/helm/**" | ||
- "examples/multiubuntu/build/**" | ||
pull_request: | ||
branches: [main] | ||
paths: | ||
|
@@ -20,6 +21,7 @@ on: | |
- "examples/multiubuntu/build/**" | ||
- "pkg/KubeArmorOperator/**" | ||
- "deployments/helm/**" | ||
- "examples/multiubuntu/build/**" | ||
|
||
# Declare default permissions as read only. | ||
permissions: read-all | ||
|
@@ -75,6 +77,11 @@ jobs: | |
- name: Build KubeArmorController | ||
if: steps.filter.outputs.controller == 'true' | ||
run: make -C pkg/KubeArmorController/ docker-build TAG=latest | ||
|
||
- name: Build multiubuntu image | ||
run: | | ||
cd examples/multiubuntu/build | ||
docker build -t kubearmor/multiubuntu:latest . | ||
|
||
- name: deploy pre existing pod | ||
run: | | ||
|
@@ -84,6 +91,12 @@ jobs: | |
|
||
- name: Run KubeArmor | ||
run: | | ||
if [[ ${{ matrix.runtime }} == "containerd" ]]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why another if statement? Is there any problem for putting in the same if statement? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I thought it'd make it a bit more readable(as the kubearmor related images would be in a different block and the multiubuntu docker save block would be prominent enough. I'll make that change right away :) |
||
docker save kubearmor/multiubuntu:latest | sudo k3s ctr images import - | ||
else | ||
docker save kubearmor/multiubuntu:latest | sudo podman load | ||
sudo podman tag localhost/latest:latest docker.io/kubearmor/multiubuntu:latest | ||
fi | ||
if [[ ${{ matrix.runtime }} == "containerd" ]]; then | ||
docker save kubearmor/kubearmor-test-init:latest | sudo k3s ctr images import - | ||
docker save kubearmor/kubearmor-test:latest | sudo k3s ctr images import - | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change the name to
kubearmor/ubuntu-w-utils:latest