Skip to content

Commit bd73562

Browse files
committed
Add helm publish action
Currently publish with "-dls" and a git commit hash until a better versioning scheme has been decided.
1 parent 8533687 commit bd73562

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

.github/workflows/helm_deploy.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Build and publish helm charts
2+
3+
on:
4+
push:
5+
branches:
6+
- dls
7+
8+
env:
9+
HELM_VERSION_TO_INSTALL: 3.18.3
10+
11+
jobs:
12+
build-and-push-helm-charts:
13+
name: publish helm charts to ghcr.io
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
19+
- name: install helm
20+
uses: Azure/setup-helm@v3
21+
with:
22+
version: ${{ env.HELM_VERSION_TO_INSTALL }}
23+
24+
- name: push the helm chart
25+
run: |
26+
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io/${{ github.repository_owner }} --username ${{ github.repository_owner }} --password-stdin
27+
28+
REGISTRY=oci://ghcr.io/DiamondLightSource/user-office-helm
29+
CHARTS=$(realpath backend/duo-backend factory/duo-factory frontend/duo-frontend gateway/duo-gateway scheduler-backend/duo-scheduler-backend scheduler-frontend/duo-scheduler-frontend user-office-app)
30+
31+
set -x
32+
33+
TAG=0.1.0-dls+$(git describe --always)
34+
echo "Charts will be released as version: ${TAG}"
35+
36+
for chart in $CHARTS; do
37+
(
38+
cd $chart
39+
NAME=$(sed -n '/^name: */s///p' Chart.yaml)
40+
41+
helm package -u --app-version ${TAG} --version ${TAG} .
42+
PACKAGE=${NAME}-${TAG}.tgz
43+
44+
helm push "$PACKAGE" $REGISTRY
45+
)
46+
done

0 commit comments

Comments
 (0)