Skip to content

Commit 0495fd0

Browse files
Merge pull request #5 from TukaTek/feature/TUK-23
Feature/tuk 23
2 parents 10eab6e + 7db0172 commit 0495fd0

File tree

6 files changed

+193
-62
lines changed

6 files changed

+193
-62
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Build & Deploy Onyx Webserver
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
paths:
8+
- 'web/**'
9+
- '.github/workflows/onyx-pipeline-webserver.yaml'
10+
11+
env:
12+
ACR_REPOSITORY: onyx-web-server
13+
ACR_LOGIN_SERVER: ${{ secrets.ACR_LOGIN_SERVER }}
14+
HELM_RELEASE: onyx
15+
HELM_NAMESPACE: onyx
16+
17+
jobs:
18+
build-and-push:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout Code
22+
uses: actions/checkout@v4
23+
24+
- name: Set IMAGE_TAG
25+
run: echo "IMAGE_TAG=v1.${{ github.run_number }}" >> $GITHUB_ENV
26+
27+
- name: Log in to Azure Container Registry(ACR)
28+
uses: docker/login-action@v3
29+
with:
30+
registry: ${{ secrets.ACR_LOGIN_SERVER }}
31+
username: ${{ secrets.ACR_USERNAME }}
32+
password: ${{ secrets.ACR_PASSWORD }}
33+
34+
- name: Build & Push Docker Image
35+
run: |
36+
docker build -t $ACR_LOGIN_SERVER/$ACR_REPOSITORY:$IMAGE_TAG -t $ACR_LOGIN_SERVER/$ACR_REPOSITORY:latest -f web/Dockerfile ./web
37+
docker push $ACR_LOGIN_SERVER/$ACR_REPOSITORY:$IMAGE_TAG
38+
docker push $ACR_LOGIN_SERVER/$ACR_REPOSITORY:latest
39+
40+
- name: Setup kubeconfig
41+
run: |
42+
echo "${{ secrets.KUBECONFIG }}" | base64 --decode > kubeconfig
43+
chmod 600 kubeconfig
44+
45+
- name: Get pods
46+
env:
47+
KUBECONFIG: ${{ github.workspace }}/kubeconfig
48+
run: kubectl get pods -n onyx

deployment/helm/charts/onyx/templates/api-deployment.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,26 @@ spec:
5757
name: {{ .Values.config.envConfigMapName }}
5858
env:
5959
{{- include "onyx-stack.envSecrets" . | nindent 12}}
60+
volumeMounts:
61+
{{- range .Values.api.volumeMounts }}
62+
- name: {{ .name }}
63+
mountPath: {{ .mountPath }}
64+
{{- if .readOnly }}
65+
readOnly: {{ .readOnly }}
66+
{{- end }}
67+
{{- end }}
68+
volumes:
69+
{{- range .Values.api.volumes }}
70+
- name: {{ .name }}
71+
{{- if .persistentVolumeClaim }}
72+
persistentVolumeClaim:
73+
claimName: {{ .persistentVolumeClaim.claimName }}
74+
{{- else if .secret }}
75+
secret:
76+
secretName: {{ .secret.secretName }}
77+
optional: {{ .secret.optional | default false }}
78+
{{- end }}
79+
{{- end }}
80+
81+
82+

deployment/helm/charts/onyx/templates/api-hpa.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ spec:
99
scaleTargetRef:
1010
apiVersion: apps/v1
1111
kind: Deployment
12-
name: {{ include "onyx-stack.fullname" . }}
12+
name: {{ include "onyx-stack.fullname" . }}-api-deployment
1313
minReplicas: {{ .Values.api.autoscaling.minReplicas }}
1414
maxReplicas: {{ .Values.api.autoscaling.maxReplicas }}
1515
metrics:
@@ -30,3 +30,5 @@ spec:
3030
averageUtilization: {{ .Values.api.autoscaling.targetMemoryUtilizationPercentage }}
3131
{{- end }}
3232
{{- end }}
33+
34+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: v1
2+
kind: PersistentVolumeClaim
3+
metadata:
4+
name: {{ .Values.api.pvc.name }}
5+
namespace: {{ .Release.Namespace }}
6+
labels:
7+
{{- include "onyx-stack.labels" . | nindent 4 }}
8+
spec:
9+
accessModes:
10+
{{- toYaml .Values.api.pvc.accessModes | nindent 4 }}
11+
resources:
12+
requests:
13+
storage: {{ .Values.api.pvc.storage }}
14+
{{- if .Values.persistent.storageClassName }}
15+
storageClassName: {{ .Values.persistent.storageClassName }}
16+
{{- end }}

deployment/helm/charts/onyx/templates/webserver-hpa.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ spec:
99
scaleTargetRef:
1010
apiVersion: apps/v1
1111
kind: Deployment
12-
name: {{ include "onyx-stack.fullname" . }}
12+
name: {{ include "onyx-stack.fullname" . }}-webserver
1313
minReplicas: {{ .Values.webserver.autoscaling.minReplicas }}
1414
maxReplicas: {{ .Values.webserver.autoscaling.maxReplicas }}
1515
metrics:

0 commit comments

Comments
 (0)