Merge pull request #10 from nebari-dev/aktech/japps-config-overrides #14
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: Release Chart | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'Chart.yaml' | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| fetch-depth: 0 | |
| - name: Configure Git | |
| run: | | |
| git config user.name "$GITHUB_ACTOR" | |
| git config user.email "$GITHUB_ACTOR@users.noreply.github.com" | |
| - name: Install Helm | |
| run: curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash | |
| - name: Get chart version | |
| id: chart | |
| run: | | |
| echo "version=$(grep '^version:' Chart.yaml | awk '{print $2}')" >> $GITHUB_OUTPUT | |
| echo "name=$(grep '^name:' Chart.yaml | awk '{print $2}')" >> $GITHUB_OUTPUT | |
| - name: Check if release exists | |
| id: check | |
| run: | | |
| if gh release view "${{ steps.chart.outputs.name }}-${{ steps.chart.outputs.version }}" &>/dev/null; then | |
| echo "exists=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "exists=false" >> $GITHUB_OUTPUT | |
| fi | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Update Helm dependencies | |
| if: steps.check.outputs.exists == 'false' | |
| run: helm dependency update | |
| - name: Package chart | |
| if: steps.check.outputs.exists == 'false' | |
| run: helm package . | |
| - name: Create GitHub release | |
| if: steps.check.outputs.exists == 'false' | |
| run: | | |
| gh release create "${{ steps.chart.outputs.name }}-${{ steps.chart.outputs.version }}" \ | |
| --title "${{ steps.chart.outputs.name }}-${{ steps.chart.outputs.version }}" \ | |
| --generate-notes \ | |
| *.tgz | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Update Helm repo index | |
| if: steps.check.outputs.exists == 'false' | |
| run: | | |
| mkdir -p gh-pages | |
| cp *.tgz gh-pages/ | |
| cd gh-pages | |
| git init | |
| git checkout -b gh-pages | |
| git config user.name "$GITHUB_ACTOR" | |
| git config user.email "$GITHUB_ACTOR@users.noreply.github.com" | |
| git remote add origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | |
| helm repo index . --url https://github.com/${{ github.repository }}/releases/download/${{ steps.chart.outputs.name }}-${{ steps.chart.outputs.version }} | |
| git add . | |
| git commit -m "Release ${{ steps.chart.outputs.name }}-${{ steps.chart.outputs.version }}" | |
| git push origin gh-pages --force |