From 6486bc6ab56658b38678ae4cf8b7d6cbdc6a7b61 Mon Sep 17 00:00:00 2001 From: Sergio Arroutbi Date: Thu, 5 Oct 2023 16:08:34 +0200 Subject: [PATCH] Include GA for build and deploy with Minikube Resolves: #9 Signed-off-by: Sergio Arroutbi --- .github/workflows/deploy.yaml | 28 ++++++++++++++++++ .../workflows/scripts/install_dependencies.sh | 29 +++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 .github/workflows/deploy.yaml create mode 100644 .github/workflows/scripts/install_dependencies.sh diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..95e09fb --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,28 @@ +--- +name: "Build and deploy" + +on: + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install dependencies (kubectl, helm, clamscan, make) + run: sh .github/workflows/scripts/install_dependencies.sh + + - name: Build + run: helm build + + - name: Minikube Installation + id: minikube + uses: medyagh/setup-minikube@latest + + - name: Status + run: minikube status + + - name: Deploy + run: helm deploy diff --git a/.github/workflows/scripts/install_dependencies.sh b/.github/workflows/scripts/install_dependencies.sh new file mode 100644 index 0000000..097b05b --- /dev/null +++ b/.github/workflows/scripts/install_dependencies.sh @@ -0,0 +1,29 @@ +#!/bin/sh -e +# +# Copyright 2023 The Keylime Authors +# SPDX-License-Identifier: Apache-2.0 +# +COMMON="helm" +COMMAND_CHECK="helm docker" + +case "${DISTRO}" in +debian:*|ubuntu:*) + export DEBIAN_FRONTEND=noninteractive + apt clean + apt update + # We get some errors once in a while, so let's try a few times. + for i in 1 2 3; do + apt -y install ${COMMON} && break + sleep ${i} + done + ;; +esac + +echo "================= SYSTEM =================" +cat /etc/os-release +uname -a +echo "==========================================" + +for command in ${COMMAND_CHECK}; do + command -v "${command}" +done