Adding javelin-webapp chart version : 1.0.10 #18
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: | |
- "main" | |
paths: | |
- '**.tgz' | |
env: | |
env_var: ${{ vars.ENV_CONTEXT_VAR }} | |
CHARTS_REPO: "getjavelin/charts" | |
CHARTS_LOCAL_REPO: "charts-repo" | |
CHARTS_NAME: "javelin-webapp javelin-admin javelin-core" | |
CHART_RETENTION: "50" | |
jobs: | |
index-update: | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, 'skip ci')" | |
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: main | |
path: ${{ env.CHARTS_LOCAL_REPO }} | |
- name: Helm Installation | |
uses: azure/[email protected] | |
with: | |
# version: v3.13.0 | |
version: latest | |
token: ${{ secrets.DEVOPS_GITHUB_TOKEN }} | |
- 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 in ${{ env.CHARTS_NAME }} ; do | |
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 main |