Skip to content

Commit

Permalink
ci: Add workflow to build and push the oci helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
mircea-pavel-anton committed Sep 9, 2024
1 parent 33bceb4 commit 1fecc2a
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/helm-publish-oci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: Build and Push Helm Chart

on:
workflow_dispatch: {}
push:
branches: [main]
paths:
- "charts/k8s-resource/**"

jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Generate Token
uses: actions/[email protected]
id: app-token
with:
app-id: "${{ secrets.BOT_APP_ID }}"
private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}"

- name: Checkout
uses: actions/[email protected]
with:
token: "${{ steps.app-token.outputs.token }}"

- name: Set up Helm
uses: azure/[email protected]
with:
version: v3.15.4

- name: Helm login to GHCR
run: |
echo ${{ secrets.GHCR_RW_TOKEN }} | helm registry login ghcr.io --username ${{ github.actor }} --password-stdin
- name: Package Helm chart
working-directory: ./charts/k8s-resource
run: helm package .

- name: Push Helm chart to GHCR
working-directory: ./charts/k8s-resource
run: helm push $(ls *.tgz) oci://ghcr.io/${{ github.repository }}

0 comments on commit 1fecc2a

Please sign in to comment.