diff --git a/.github/workflows/helm-release-chart.yml b/.github/workflows/helm-release-chart.yml new file mode 100644 index 00000000..722ac1a7 --- /dev/null +++ b/.github/workflows/helm-release-chart.yml @@ -0,0 +1,39 @@ +name: Release Helm Chart +on: + push: + tags: + - v* + workflow_dispatch: + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Helm + uses: azure/setup-helm@v4 + + - name: Log in to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Update Helm Dependencies + run: | + helm dependency update ./chart + + - name: Package Helm Chart + run: | + export tag=$(echo ${GITHUB_REF#refs/tags/} | sed 's/^v//') + helm package ./chart --version $tag --app-version $tag + env: + GITHUB_REF: ${{ github.ref }} + + - name: Push Helm Chart to GHCR + run: | + helm push packaged-chart.tgz oci://ghcr.io/${{ github.repository_owner }}/helm-charts diff --git a/.github/workflows/helm-test-chart.yml b/.github/workflows/helm-test-chart.yml new file mode 100644 index 00000000..7c9ebc38 --- /dev/null +++ b/.github/workflows/helm-test-chart.yml @@ -0,0 +1,45 @@ +name: Test Helm Chart + +on: + push: + branches: + - master + - next + pull_request: + workflow_dispatch: + +jobs: + test-helm-chart: + name: Test Helm Chart + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Helm + uses: azure/setup-helm@v4 + + - name: Lint the Helm chart + run: | + helm lint ./chart + + - name: Create Kind cluster + uses: helm/kind-action@v1 + + - name: Install Helm chart in Kind cluster (Dry Run) + run: | + helm dependency update ./chart + helm install test-release ./chart --dry-run --debug + + - name: Deploy Helm chart to Kind cluster + run: | + helm install test-release ./chart + + - name: Verify Helm release + run: | + kubectl get all + + - name: Cleanup Kind cluster + run: | + kind delete cluster diff --git a/chart/Chart.yaml b/chart/Chart.yaml index 4ffadd72..4a2bf810 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -35,4 +35,4 @@ dependencies: - condition: rabbitmq.enabled name: rabbitmq repository: https://charts.bitnami.com/bitnami - version: 15.1.0 \ No newline at end of file + version: 15.1.0