File tree Expand file tree Collapse file tree 3 files changed +57
-0
lines changed Expand file tree Collapse file tree 3 files changed +57
-0
lines changed Original file line number Diff line number Diff line change 88 - v*
99
1010jobs :
11+ helm-oci :
12+ runs-on : ubuntu-latest
13+ permissions :
14+ contents : read
15+ packages : write
16+ steps :
17+ - uses : actions/checkout@v4
18+ with :
19+ fetch-depth : 0
20+ - uses : docker/login-action@v3
21+ with :
22+ registry : ghcr.io
23+ username : ${{ github.actor }}
24+ password : ${{ secrets.GITHUB_TOKEN }}
25+ 26+ - name : Push artifacts
27+ run : PUSH=true hack/push-artifacts.sh ghcr.io/stackitcloud/yawol/yawol-controller
1128 build :
1229 runs-on : ubuntu-latest
1330 permissions :
Original file line number Diff line number Diff line change 1+ artifacts
2+
13# Binaries for programs and plugins
24* .exe
35* .exe~
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -o errexit
4+ set -o nounset
5+ set -o pipefail
6+
7+ chart_name=yawol-controller
8+ helm_artifacts=artifacts/charts
9+ rm -rf " $helm_artifacts "
10+ mkdir -p " $helm_artifacts "
11+
12+ function image_registry() {
13+ echo " $1 " | cut -d ' /' -f -2
14+ }
15+
16+ function image_repo() {
17+ echo " $1 " | cut -d ' :' -f 1
18+ }
19+
20+ function image_tag() {
21+ git describe --tag --always --dirty
22+ }
23+
24+ # # HELM
25+ cp -r charts/${chart_name} " $helm_artifacts "
26+ yq -i " \
27+ ( .image.repository = \" $( image_repo " $1 " ) \" ) | \
28+ ( .image.tag = \" $( image_tag " $1 " ) \" )\
29+ " " $helm_artifacts /${chart_name} /values.yaml"
30+
31+ # push to registry
32+ if [ " ${PUSH:= } " != " true" ] ; then
33+ echo " Skip pushing artifacts because PUSH is not set to 'true'"
34+ exit 0
35+ fi
36+
37+ helm package " $helm_artifacts /${chart_name} " --version " $( image_tag " $1 " ) " -d " $helm_artifacts " > /dev/null 2>&1
38+ helm push " $helm_artifacts /${chart_name} -" * " oci://$( image_registry " $1 " ) /charts"
You can’t perform that action at this time.
0 commit comments