Skip to content

5-Publish Helm chart #3

5-Publish Helm chart

5-Publish Helm chart #3

name: 5-Publish Helm chart
on:
workflow_dispatch:
concurrency:
group: publish-helm-chart
cancel-in-progress: true
jobs:
push-helm-charts:
if: github.repository == 'Green-Software-Foundation/carbon-aware-sdk' || vars.ENABLE_HELM_WORKFLOW == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Detect Helm chart version
run: |
CHART_VERSION=`yq .version helm-chart/Chart.yaml`
echo "CHART_VERSION=$CHART_VERSION" >> "$GITHUB_ENV"
- name: Packaging
run: helm package helm-chart
- name: Log in to the Container registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Push charts to GHCR
run: |
OWNER_LOWER=${GITHUB_REPOSITORY_OWNER,,}
helm push carbon-aware-sdk-${{ env.CHART_VERSION }}.tgz "oci://ghcr.io/$OWNER_LOWER/charts"
shell: bash