Skip to content

Commit

Permalink
Update action.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
kprateep authored Jul 10, 2024
1 parent 3b5496d commit a40b796
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions .github/workflows/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,23 @@ name: Accuknox-Job Workflow

on:
push:
branches:
- main
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-*"
pull_request_target:
branches:
- "*"


jobs:
tag-validate:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: rubenesp87/[email protected]
with:
version: ${{ github.ref_name }}

helm_chart_validation:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -43,7 +53,7 @@ jobs:
helm_push_to_ecr:
runs-on: ubuntu-latest
needs: [helm_chart_validation]
needs: [helm_chart_validation,tag-validate]
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -65,10 +75,21 @@ jobs:
run: |
aws ecr-public get-login-password --region us-east-1 | helm registry login --username AWS --password-stdin ${{ secrets.REPO }}
- name: Chart versioning
if: ( github.event_name != 'pull_request' && github.event_name != 'pull_request_target' )
shell: bash
id: chart-version
run: |
for CHART_DIR in cis-k8s-job k8s-risk-assessment-job k8tls-job kiem-job; do
sed -i "s/^version:.*$/version: ${{ github.ref_name }}/" $CHART_DIR/Chart.yaml
sed -i "s/^appVersion:.*$/appVersion: ${{ github.ref_name }}/" $CHART_DIR/Chart.yaml
done
- 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
done

0 comments on commit a40b796

Please sign in to comment.