Skip to content

find github ref tag #25

find github ref tag

find github ref tag #25

name: Helm package and push to ghcr.io
on:
# publish on releases, e.g. v2.1.13 (image tagged as "2.1.13" - "v" prefix is removed)
# release:
# types: [ published ]
push:
tags:
- "v*.*.*"
# branches:
# - 'main'
# paths:
# - 'helm-chart/**'
# - '.github/workflows/helm-package-and-publish.yaml'
# TODO:
# - package helm
# - upload release artifact
# - get its url
# - update/merge gh-pages/index.yaml
jobs:
helm-package-and-push-to-ghcr-io:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Helm
uses: azure/[email protected]
- name: Helm Package and Push to ghcr.io
id: helm_package
run: |
echo "Tag version: $GITHUB_REF"
RELEASE_TAG="${{ github.event.release.tag_name }}"
VERSION="${RELEASE_TAG:-v6.6.6}"
CLEAN_VERSION="${VERSION#v}"
echo "RELEASE Version: $CLEAN_VERSION"
PACKAGE_OUTPUT=$(helm package --version "$CLEAN_VERSION" helm-chart)
echo "PACKAGE_OUTPUT=$PACKAGE_OUTPUT"
PACKAGE_NAME=$(basename "$PACKAGE_OUTPUT")
echo "Generated helm package: $PACKAGE_NAME"
# save the generated package name to github_output to pass it to next step
echo "package-name=$PACKAGE_NAME" >> $GITHUB_OUTPUT
- name: test
id: test
run: |
echo "message=$MESSAGE"
env:
MESSAGE: ${{ steps.helm_package.outputs.package-name}}
- name: Release
uses: softprops/[email protected]
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{ steps.helm_package.outputs.package-name}}
token: ${{ secrets.GHCR_TOKEN }}