new-helm-chart-version #17
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: Update and Index Helm Charts | |
on: | |
repository_dispatch: | |
types: [new-helm-chart-version] | |
jobs: | |
cleanup: | |
runs-on: ubuntu-latest | |
permissions: write-all | |
steps: | |
- name: Delete deployment | |
uses: strumwolf/delete-deployment-environment@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
environment: github-pages | |
onlyRemoveDeployments: true | |
update-charts: | |
runs-on: ubuntu-latest | |
needs: cleanup | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set Up Helm | |
run: | | |
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash | |
helm version | |
- name: Log In to Helm Registry | |
run: | | |
helm registry login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} | |
- name: Fetch and Store New Chart | |
run: | | |
helm pull oci://ghcr.io/caas-team/charts/${{ github.event.client_payload.chart }} --version ${{ github.event.client_payload.version }} | |
- name: Update Index File | |
run: | | |
mkdir -p ${{ github.event.client_payload.chart }} | |
mv ${{ github.event.client_payload.chart }}*.tgz ${{ github.event.client_payload.chart }} | |
helm repo index --url https://caas-team.github.io/helm-charts/ . | |
git config user.name "github-actions" | |
git config user.email "[email protected]" | |
git add -A | |
git commit -m "Update Helm chart and index.yaml for ${{ github.event.client_payload.chart }}@${{ github.event.client_payload.version }}" | |
git push |