Releasing new chart version #159
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 Helm Charts Index | |
on: | |
push: | |
branches: | |
- "charts" | |
paths: | |
- '**.tgz' | |
env: | |
env_var: ${{ vars.ENV_CONTEXT_VAR }} | |
CHARTS_REPO: "getjavelin/charts" | |
CHARTS_BRANCH: "charts" | |
CHARTS_LOCAL_REPO: "charts-repo" | |
CHART_RETENTION: "20" | |
jobs: | |
index-update: | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Git Checkout | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ env.CHARTS_REPO }} | |
token: ${{ secrets.DEVOPS_GITHUB_TOKEN }} | |
fetch-depth: 0 | |
persist-credentials: true | |
ref: ${{ env.CHARTS_BRANCH }} | |
path: ${{ env.CHARTS_LOCAL_REPO }} | |
- name: Helm Installation | |
uses: azure/[email protected] | |
with: | |
# version: v3.13.0 | |
version: latest | |
- name: Update Index | |
env: | |
GITHUB_TOKEN: ${{ secrets.DEVOPS_GITHUB_TOKEN }} | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "DevOps Bot" | |
cd ${{ env.CHARTS_LOCAL_REPO }} | |
git pull | |
for mychart_ver in $(ls release) ; do | |
mychart=$(echo ${mychart_ver} | sed "s|_do_not_edit.txt||g") | |
ls -trl ${mychart}*.tgz | grep -v latest | awk '{print $9}' | tail -n +${{ env.CHART_RETENTION }} | xargs -I {} rm -- {} | |
done | |
helm repo index . | |
git add . | |
git commit -m "Updating chart index - [skip ci]" | |
git push origin ${{ env.CHARTS_BRANCH }} |