-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (38 loc) · 1.25 KB
/
helm_deploy.yml
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
name: Build and publish helm charts
on:
push:
pull_request:
env:
HELM_VERSION_TO_INSTALL: 3.14.3
jobs:
build-and-push-helm-charts:
name: publish helm charts to ghcr.io
runs-on: ubuntu-latest
environment: prod
steps:
- name: Checkout
uses: actions/checkout@v2
- name: install helm
uses: Azure/setup-helm@v3
with:
version: ${{ env.HELM_VERSION_TO_INSTALL }}
- name: push the helm chart
run: |
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io/${{ github.repository_owner }} --username ${{ github.repository_owner }} --password-stdin
REGISTRY=oci://ghcr.io/epics-containers
set -x
# helm tags must be SemVar. Use 0.0.0-b0 for testing the latest non-tagged build
if [ "${GITHUB_REF_TYPE}" == "tag" ] ; then
TAG=${GITHUB_REF_NAME}
else
TAG="0.0.0-b0"
fi
for chart in Charts/*; do
(
cd $(realpath $chart)
NAME=$(sed -n '/^name: */s///p' Chart.yaml)
helm package -u --app-version ${TAG} --version ${TAG} .
PACKAGE=${NAME}-${TAG}.tgz
helm push "$PACKAGE" $REGISTRY
)
done