diff --git a/.github/workflows/ci-build-and-push-ubuntu.yml b/.github/workflows/ci-build-and-push-ubuntu.yml new file mode 100644 index 000000000..e129ef8c5 --- /dev/null +++ b/.github/workflows/ci-build-and-push-ubuntu.yml @@ -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 diff --git a/.github/workflows/ci-test-ginkgo.yml b/.github/workflows/ci-test-ginkgo.yml index 6b1752963..c326c833e 100644 --- a/.github/workflows/ci-test-ginkgo.yml +++ b/.github/workflows/ci-test-ginkgo.yml @@ -10,6 +10,7 @@ on: - ".github/workflows/ci-test-ginkgo.yml" - "pkg/KubeArmorOperator/**" - "deployments/helm/**" + - "examples/multiubuntu/build/**" pull_request: branches: [main] paths: @@ -17,9 +18,9 @@ on: - "tests/**" - "protobuf/**" - ".github/workflows/ci-test-ginkgo.yml" - - "examples/multiubuntu/build/**" - "pkg/KubeArmorOperator/**" - "deployments/helm/**" + - "examples/multiubuntu/build/**" # Declare default permissions as read only. permissions: read-all @@ -75,6 +76,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/ubuntu-w-utils:latest . - name: deploy pre existing pod run: | @@ -89,7 +95,8 @@ jobs: docker save kubearmor/kubearmor-test:latest | sudo k3s ctr images import - docker save kubearmor/kubearmor-operator:latest | sudo k3s ctr images import - docker save kubearmor/kubearmor-snitch:latest | sudo k3s ctr images import - - + docker save kubearmor/ubuntu-w-utils:latest | sudo k3s ctr images import - + if [[ ${{ steps.filter.outputs.controller }} == 'true' ]]; then docker save kubearmor/kubearmor-controller:latest | sudo k3s ctr images import - fi @@ -103,6 +110,9 @@ jobs: sudo podman tag localhost/latest:latest docker.io/kubearmor/kubearmor-operator:latest docker save kubearmor/kubearmor-snitch:latest | sudo podman load sudo podman tag localhost/latest:latest docker.io/kubearmor/kubearmor-snitch:latest + docker save kubearmor/ubuntu-w-utils:latest | sudo podman load + sudo podman tag localhost/latest:latest docker.io/kubearmor/ubuntu-w-utils:latest + if [ ${{ steps.filter.outputs.controller }} == 'true' ]; then docker save kubearmor/kubearmor-controller:latest | sudo podman load sudo podman tag localhost/latest:latest docker.io/kubearmor/kubearmor-controller:latest