diff --git a/.github/actions/generate-helm-html-index/action.yaml b/.github/actions/generate-helm-html-index/action.yaml
new file mode 100644
index 0000000..f595e9b
--- /dev/null
+++ b/.github/actions/generate-helm-html-index/action.yaml
@@ -0,0 +1,131 @@
+# .github/actions/helm-chart-generator/action.yml
+name: 'Helm Chart HTML Generator'
+description: 'Generates a static HTML page from Helm chart index.yaml file'
+
+inputs:
+ index_file:
+ description: 'Path to the index.yaml file'
+ required: false
+ default: 'index.yaml'
+ output_file:
+ description: 'Output HTML file path'
+ required: false
+ default: 'index.html'
+
+runs:
+ using: "composite"
+ steps:
+ - name: Setup Python
+ uses: actions/setup-python@v4
+ with:
+ python-version: '3.x'
+
+ - name: Install Dependencies
+ shell: bash
+ run: |
+ python -m pip install --upgrade pip
+ pip install pyyaml
+
+ - name: Run Generator Script
+ shell: python
+ env:
+ INDEX_FILE: ${{ inputs.index_file }}
+ OUTPUT_FILE: ${{ inputs.output_file }}
+ run: |
+ import os
+ import sys
+ import yaml
+ from datetime import datetime
+
+ # Debug information
+ print("Environment variables:")
+ for key, value in os.environ.items():
+ if key.startswith(('INDEX_', 'OUTPUT_')):
+ print(f"{key}: {value}")
+
+ # Get input parameters directly from environment
+ index_file = os.environ['INDEX_FILE']
+ output_file = os.environ['OUTPUT_FILE']
+
+ print(f"Looking for index file: {index_file}")
+ print(f"Will write to output file: {output_file}")
+
+ # Verify input file exists
+ if not os.path.exists(index_file):
+ print(f"Error: Index file '{index_file}' not found!")
+ print(f"Absolute path attempted: {os.path.abspath(index_file)}")
+ sys.exit(1)
+
+ # Read YAML file
+ try:
+ with open(index_file, 'r') as f:
+ data = yaml.safe_load(f)
+ except Exception as e:
+ print(f"Error reading YAML file: {e}")
+ sys.exit(1)
+
+ # Generate HTML
+ html = f"""
+
+
+
+
+
+ Helm Charts Repository
+
+
+
+ Helm Charts Repository
+ """
+
+ # Add chart entries
+ for chart_name, versions in data.get('entries', {}).items():
+ for version in versions:
+ html += f"""
+
+
+
{version.get('description', '')}
+
+
Version {version['version']}
+
App Version: {version.get('appVersion', 'N/A')}
+
Created: {version.get('created', 'N/A')}
+
Download Chart
+
+
+ """
+
+ html += f"""
+
+
+
+ """
+
+ # Write HTML file
+ try:
+ with open(output_file, 'w') as f:
+ f.write(html)
+ print(f"Successfully generated {output_file}")
+ except Exception as e:
+ print(f"Error writing HTML file: {e}")
+ sys.exit(1)
\ No newline at end of file
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
new file mode 100644
index 0000000..645b983
--- /dev/null
+++ b/.github/workflows/release.yaml
@@ -0,0 +1,64 @@
+name: Release Charts
+
+on:
+ push:
+ branches:
+ - master
+
+jobs:
+ release:
+ permissions:
+ contents: write # to push chart release and create a release (helm/chart-releaser-action)
+
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Code
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ - name: Configure Git
+ run: |
+ git config user.name "$GITHUB_ACTOR"
+ git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
+ - name: Set up Helm
+ uses: azure/setup-helm@v3.5
+ with:
+ version: v3.9.2
+
+ - name: Run chart-releaser
+ uses: helm/chart-releaser-action@v1.6.0
+ env:
+ CR_TOKEN: "${{ github.token }}"
+
+ generate-page:
+ runs-on: ubuntu-latest
+ permissions:
+ contents: write # Needed to commit the generated file
+ needs:
+ - release
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ ref: gh-pages
+ fetch-depth: 0
+
+ - name: debug-print
+ run: |
+ echo "Current directory is $(pwd)"
+ echo "Contents of the directory are $(ls -la)"
+ echo "Contents of the directory are $(ls -la /home/runner/work/helm-release/helm-release/)"
+
+ - name: Generate Helm Charts HTML
+ uses: ./.github/actions/generate-helm-html-index
+ with:
+ index-file: 'index.yaml'
+ output-file: 'index.html'
+
+ - name: Commit and Push
+ run: |
+ git config --local user.email "action@github.com"
+ git config --local user.name "GitHub Action"
+ git add index.html
+ git commit -m "Update Helm charts page" || exit 0 # Don't fail if no changes
+ git push
\ No newline at end of file