From e9355d0aa9edc31f30fe8c596ba47baf7d109390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20Pl=C3=BCddemann?= Date: Mon, 28 Oct 2024 18:11:23 +0100 Subject: [PATCH] publish helm chart to gh pages --- .github/workflows/package-helm-chart.yml | 67 ++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/package-helm-chart.yml diff --git a/.github/workflows/package-helm-chart.yml b/.github/workflows/package-helm-chart.yml new file mode 100644 index 0000000..812750b --- /dev/null +++ b/.github/workflows/package-helm-chart.yml @@ -0,0 +1,67 @@ +name: package-helm-chart + +on: + push: + branches: + - main + paths: + - 'deploy/helm/**' + + workflow_dispatch: + +jobs: + package-helm-chart: + permissions: + contents: read + packages: write + + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set environment variables + id: set-variables + run: | + echo "REPOSITORY=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT" + echo "VERSION=$(yq -r .version ./deploy/helm/grafana-ldap-sync/Chart.yaml)" >> "$GITHUB_OUTPUT" + + - name: Env variable output + id: test-variables + run: | + echo ${{ steps.set-variables.outputs.REPOSITORY }} + echo ${{ steps.set-variables.outputs.VERSION }} + + - name: Login to GitHub Container Registry + uses: docker/v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ github.token }} + + - name: Package and push helm chart + run: | + helm package ./deploy/helm/grafana-ldap-sync --version ${{ steps.set-variables.outputs.VERSION }} + helm push ./grafana-ldap-sync-${{ steps.set-variables.outputs.VERSION }}.tgz oci://${{ steps.set-variables.outputs.REPOSITORY }}/charts + + publish-helm-chart: + permissions: + id-token: write + packages: write + contents: write + actions: read + deployments: read + pull-requests: read + + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Publish Helm chart to GitHub Pages + uses: stefanprodan/helm-gh-pages@master + with: + token: ${{ secrets.GITHUB_TOKEN }} + linting: off \ No newline at end of file