Skip to content

Merge pull request #23 from raviknox/main #106

Merge pull request #23 from raviknox/main

Merge pull request #23 from raviknox/main #106

Workflow file for this run

name: Accuknox-Job Workflow
on:
push:
branches:
- main
pull_request_target:
branches:
- "*"
jobs:
helm_chart_validation:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Helm
run: |
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
- name: Validate cis-k8s-job
run: |
helm lint cis-k8s-job
helm template cis-k8s-job --dry-run > /dev/null
- name: Validate k8s-risk-assessment-job
run: |
helm lint k8s-risk-assessment-job
helm template k8s-risk-assessment-job --dry-run > /dev/null
- name: Validate k8tls-job
run: |
helm lint k8tls-job
helm template k8tls-job --dry-run > /dev/null
- name: Validate kiem-job
run: |
helm lint kiem-job
helm template kiem-job --dry-run > /dev/null
helm_push_to_ecr:
runs-on: ubuntu-latest
needs: [helm_chart_validation]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Install Helm
run: |
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
- name: Login to AWS ECR
run: |
aws ecr-public get-login-password --region us-east-1 | helm registry login --username AWS --password-stdin ${{ secrets.REPO }}
- name: Package and Push Helm Charts
run: |
for CHART_DIR in cis-k8s-job k8s-risk-assessment-job k8tls-job kiem-job; do
helm package $CHART_DIR
HELM_PACKAGE=$(ls $CHART_DIR-*.tgz)
helm push $HELM_PACKAGE oci://${{ secrets.REPO }}
done