forked from liferay/liferay-portal
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathci-publish-cloud-helm-chart.yaml
More file actions
53 lines (45 loc) · 1.72 KB
/
ci-publish-cloud-helm-chart.yaml
File metadata and controls
53 lines (45 loc) · 1.72 KB
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
defaults:
run:
shell: bash
env:
CHART_VERSION: "0.0.0"
GAR_REPOSITORY: "us-central1-docker.pkg.dev/liferay-artifact-registry/liferay-helm-chart"
jobs:
publish-cloud-helm-chart:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Calculate Helm chart version
run: |
#
# heml-chart-1.0.5
#
LATEST_HELM_CHART_TAG=$(git describe --tags --match="helm-chart-*" HEAD)
#
# 1.0.5
#
CHART_VERSION=${LATEST_HELM_CHART_TAG#"helm-chart-"}
echo "Calculated Helm chart version ${CHART_VERSION}."
echo "CHART_VERSION=${CHART_VERSION}" >> ${GITHUB_ENV}
- name: Package Helm chart
run: |
mkdir "${{ runner.temp }}/dist"
helm package --destination "${{ runner.temp }}/dist" --version ${CHART_VERSION} .
working-directory: ./cloud/helm
- name: Log in to GAR
run: echo "${{ secrets.GAR_PASSWORD }}" | helm registry login ${GAR_REPOSITORY} --password-stdin --username _json_key_base64
- name: Push Helm chart to GAR
run: |
for file_name in *.tgz
do
echo "Pushing ${file_name}."
helm push "${file_name}" "oci://${GAR_REPOSITORY}"
done
working-directory: ${{ runner.temp }}/dist
on:
push:
branches:
- master
paths:
- cloud/**