-
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.
ci: Add workflow to build and push the oci helm chart
- Loading branch information
1 parent
33bceb4
commit 1fecc2a
Showing
1 changed file
with
42 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,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 }} |