Merge pull request #5 from wcatz/fix-secret-read #3
This file contains hidden or 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: Publish Helm Chart | |
| on: | |
| push: | |
| branches: | |
| - master | |
| tags: | |
| - 'v*.*.*' | |
| jobs: | |
| publish-chart: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Helm | |
| uses: azure/setup-helm@v4 | |
| with: | |
| version: '3.13.3' | |
| - name: Login to GitHub Container Registry | |
| run: | | |
| echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io -u ${{ github.actor }} --password-stdin | |
| - name: Package Helm chart | |
| run: | | |
| helm package helm-chart/ | |
| - name: Push Helm chart to GHCR | |
| run: | | |
| CHART_NAME=$(helm show chart helm-chart/ | grep '^name:' | awk '{print $2}') | |
| CHART_VERSION=$(helm show chart helm-chart/ | grep '^version:' | awk '{print $2}') | |
| helm push ${CHART_NAME}-${CHART_VERSION}.tgz oci://ghcr.io/wcatz/helm-charts |