-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (60 loc) · 1.92 KB
/
helm-build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Helm Chart Build
on:
workflow_dispatch:
push:
branches:
- "main"
- "release-*"
concurrency:
group: helm-${{ github.ref }}
cancel-in-progress: true
jobs:
prepare:
runs-on: ubuntu-latest
steps:
- name: Extract tag
id: extract_tag
run: |
tag=$(if [[ ${{github.ref_name}} == v* ]];then echo "${{github.ref_name}}"; else echo "latest"; fi)
echo "tag=$tag" >> $GITHUB_OUTPUT
outputs:
tag: ${{ steps.extract_tag.outputs.tag }}
helm-build:
runs-on: ubuntu-latest
needs:
- prepare
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "21"
cache: "maven"
- name: Create Helm
run: |
## Set -Dquarkus.container-image.tag as empty to remove the "v" prefix from the container image of Deployment
mvn package -DskipTests -Dquarkus.container-image.tag=
# YQ
sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq
sudo chmod +x /usr/bin/yq
APP_IMAGE_TAG=$TAG yq e -i '.appVersion=strenv(APP_IMAGE_TAG)' target/helm/Chart.yaml
env:
TAG: ${{ needs.prepare.outputs.tag }}
- name: Git add Helm
id: git-add-helm
continue-on-error: true
run: |
cp -R target/helm/ ./
if [ -z $(git status --porcelain) ]; then
echo "has_changes=false" >> $GITHUB_OUTPUT
else
echo git status
git add helm/*
echo "has_changes=true" >> $GITHUB_OUTPUT
fi
- name: Commit and Push
uses: trustification/release-tools/.github/actions/commit@main
if: steps.git-add-helm.outputs.has_changes == 'true'
with:
commit_message: "🔅 Helm chart update"
branch: ${{github.ref_name}}