Skip to content

Fixing ServiceMonitor in manifests. #26

Fixing ServiceMonitor in manifests.

Fixing ServiceMonitor in manifests. #26

Workflow file for this run

# ┬ ┬┬─┐┬ ┌┌┐
# │─┤├─ │ │││
# ┘ ┴┴─┘┘─┘┘ ┘
name: Helm
on:
# Runs on pushes targeting the default branch
push:
tags:
- v*
# Allows you to run this workflow manually from the Actions tab
# It is useful, when you update chart, but version stays the same...
# ...pipeline won't start and build the chart automatically, so...
# ...you can trigger it manually
workflow_dispatch:
inputs:
tag:
description: Application version
required: true
type: string
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: helm
cancel-in-progress: false
permissions:
contents: write
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Install Helm
uses: azure/setup-helm@v4
- name: Prepare version
run: |-
export VERSION=""
if grep -qE "${VERSION_REGEXP}" <<< "${INPUT_TAG}"; then
echo "::notice title=Version source::Taking version from workflow dispatch input: ${INPUT_TAG}"
VERSION="${INPUT_TAG}"
elif grep -qE "${VERSION_REGEXP}" <<< "${REF_NAME}"; then
echo "::notice title=Version source::Taking version from ref name: ${REF_NAME}"
VERSION="${REF_NAME}"
else
echo "::error title=Version source::Niether versions match regexp: "${INPUT_TAG}", '${REF_NAME}'"
exit 1
fi
echo "VERSION=${VERSION#v}" | tee -a $GITHUB_ENV
env:
VERSION_REGEXP: '^v[0-9]+(\.[0-9]+){2}(-.+)?$'
REF_NAME: ${{ github.ref_name }}
INPUT_TAG: ${{ inputs.tag }}
- name: Update chart appVersion
uses: mikefarah/yq@v4
with:
cmd: |-
yq -i '.appVersion = "${{ env.VERSION }}"' charts/backup-operator/Chart.yaml
yq -i '.version = "${{ env.VERSION }}"' charts/backup-operator/Chart.yaml
cat charts/backup-operator/Chart.yaml
- name: Run chart-releaser
uses: helm/[email protected]
with:
mark_as_latest: false
pages_branch: helm-charts
env:
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CR_GIT_REPO: ${{ github.repository }}