Skip to content

Commit

Permalink
feat: create github action to publish helm chart
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
LiquidPL committed Oct 22, 2024
1 parent 84d81ec commit c48c514
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/chart.yaml
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

0 comments on commit c48c514

Please sign in to comment.