Skip to content

Commit 019df99

Browse files
authored
Merge pull request #2221 from sunu/cherry-pick-helm-pipeline
Hotfix: get the helm / docker build pipeline working for production deployment
2 parents ab3e160 + 48ae642 commit 019df99

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Builds and pushes Docker Images and Helm charts to Github Registry
2+
3+
on:
4+
# Build and push Docker image and Helm charts on every push to develop branch
5+
# and on every tag push
6+
push:
7+
branches:
8+
- develop
9+
- master
10+
tags:
11+
- "**"
12+
13+
permissions:
14+
packages: write
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v3
26+
27+
- name: Login to GitHub Container Registry
28+
uses: docker/login-action@v3
29+
with:
30+
registry: ghcr.io
31+
username: ${{ github.actor }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Install chart publishing dependencies (chartpress, helm)
35+
run: |
36+
pip install chartpress
37+
pip list
38+
39+
helm version
40+
41+
- name: Build and push Docker image. Update the image tag, chart version etc as needed
42+
run: |
43+
cd deploy/helm
44+
# hack to push the image to ghcr.io. We will update chartpress.yaml when we move to separate deploy repo
45+
python -c "import re; data=open('chartpress.yaml').read(); open('chartpress.yaml', 'w').write(re.sub(r'ifrcgoacr.azurecr.io/ifrcgo-', 'ghcr.io/ifrcgo/go-', data))"
46+
chartpress --push
47+
48+
- name: Get the version
49+
id: get_version
50+
run: echo ::set-output name=VERSION::$(cat deploy/helm/ifrcgo-helm/Chart.yaml | grep version | awk '{print $2}')
51+
52+
- name: Package Helm Chart
53+
run: |
54+
helm package deploy/helm/ifrcgo-helm -d .helm-charts
55+
56+
- name: Push Helm Chart
57+
run: |
58+
helm push .helm-charts/ifrcgo-helm-${{ steps.get_version.outputs.VERSION }}.tgz oci://ghcr.io/ifrcgo/go-api

0 commit comments

Comments
 (0)