Skip to content

feat: add 'latest' tag and docs #6

feat: add 'latest' tag and docs

feat: add 'latest' tag and docs #6

Workflow file for this run

name: Helm Chart
on:
push:
branches:
- main
tags:
- "*"
jobs:
helm:
name: Publish to GitHub 📦
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Configure Git 📖
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm ⚙️
uses: azure/setup-helm@v3
- name: Login to Helm Registry 🔑
run: |
helm registry login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ghcr.io
- name: Setup Node.js 📦
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies 🔧
run: |
npm ci --include=dev
- name: Build chart 🚚
run: |
if [[ "${{ github.ref_type }}" == "tag" ]]; then
VERSION="${{ github.ref }}"
else
VERSION="0.0.0-${GITHUB_SHA::7}"
fi
sed -i "s/0.0.0/$VERSION/g" helm/Chart.yaml
npm run build:chart -- --image cubos/disk-resizer-controller:$VERSION
if [[ "${{ github.ref_type }}" == "tag" ]]; then
sed -i "s/$VERSION/latest/g" helm/Chart.yaml
npm run build:chart -- --image cubos/disk-resizer-controller:$VERSION
else
sed -i "s/$VERSION/edge/g" helm/Chart.yaml
npm run build:chart -- --image cubos/disk-resizer-controller:$VERSION
fi
- name: Publish chart 🚀
run: |
helm push *.tgz oci://ghcr.io/cubos/charts