-
Notifications
You must be signed in to change notification settings - Fork 98
41 lines (33 loc) · 1.07 KB
/
5-publish-helm-chart.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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