-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create github action to publish helm chart
[ci skip]
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Publish Helm chart | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
publish: | ||
name: Publish Helm Chart to GitHub Container registry | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
packages: write | ||
|
||
defaults: | ||
run: | ||
working-directory: ./charts/dangobot | ||
|
||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Add chart dependencies to Helm | ||
run: helm repo add bitnami https://charts.bitnami.com/bitnami | ||
|
||
- name: Download chart dependencies | ||
run: helm dependency build | ||
|
||
- name: Package chart | ||
run: helm package . | ||
|
||
- name: Get the chart version | ||
id: vars | ||
run: echo "version=$(helm show chart . | grep -E "^version:" | awk '{print $2}')" >> $GITHUB_OUTPUT | ||
|
||
- name: Login to GitHub Container Registry | ||
run: echo '${{ secrets.GITHUB_TOKEN }}' | helm registry login -u '${{ github.repository_owner }}' --password-stdin ghcr.io/${{ github.repository_owner }} | ||
|
||
- name: Push package | ||
run: helm push dangobot-${{ steps.vars.outputs.version }}.tgz oci://ghcr.io/liquidpl/charts | ||
|
||
- name: Get image | ||
id: output | ||
shell: bash | ||
run: echo 'image=${{ inputs.registry }}/${{ inputs.repository }}/${{ inputs.name }}:${{ inputs.tag }}' >> $GITHUB_OUTPUT |