Add helm chart #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Release Helm Chart | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build-and-release: | |
name: Build and Release Helm Chart to GitHub Registry | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the repository | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
# Set up Helm | |
- name: Set up Helm | |
uses: azure/setup-helm@v4.2.0 | |
# Log in to GitHub Container Registry | |
- name: Log in to GitHub Container Registry | |
run: | | |
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io --username ${{ github.actor }} --password-stdin | |
# Package the Helm chart | |
- name: Package Helm chart | |
run: | | |
helm package ./charts/homer-operator -d ./artifacts | |
# Push Helm chart to GitHub Container Registry | |
- name: Push Helm chart to GitHub Registry | |
run: | | |
CHART_NAME=$(ls ./artifacts | grep .tgz) | |
helm push ./artifacts/$CHART_NAME oci://ghcr.io/${{ github.repository_owner }}/homer-operator |