Skip to content

Commit

Permalink
feat: helm chart build & push in github action
Browse files Browse the repository at this point in the history
  • Loading branch information
joseftaha committed Jul 16, 2024
1 parent fc57ce4 commit 2eb0daa
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 11 deletions.
24 changes: 23 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
branches: '*'

jobs:

changed-dirs:
runs-on: ubuntu-latest
outputs:
Expand Down Expand Up @@ -83,4 +84,25 @@ jobs:
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
labels: ${{ steps.meta.outputs.labels }}

helm:
runs-on: ubuntu-latest
needs:
- changed-dirs
if: contains(needs.changed-dirs.outputs.changeDirs, 'charts/config-server-operator')
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Helm
uses: azure/setup-helm@v3

- name: Login to GitHub Container Registry
run: helm registry login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}

- name: Package Helm chart
run: helm package charts/config-server-operator --destination ./charts

- name: Push Helm chart to OCI registry
run: helm push ./charts/config-server-operator-*.tgz oci://ghcr.io/tu-wien-datalab
3 changes: 3 additions & 0 deletions chart/config-server-operator/templates/pre-delete-hook.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# deletes crd ressoruces applied in the operators namespace
# otherwise the deletion of the chart and namespace may stuck
apiVersion: batch/v1
kind: Job
metadata:
Expand All @@ -18,4 +20,5 @@ spec:
- |
kubectl delete cfg-server --all -n {{ .Values.namespace }}
kubectl delete kvp --all -n {{ .Values.namespace }}
restartPolicy: OnFailure
10 changes: 0 additions & 10 deletions chart/config-server-operator/templates/server.yaml

This file was deleted.

0 comments on commit 2eb0daa

Please sign in to comment.