Build and Push Helm Chart #3
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
--- | |
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 }} |