-
Notifications
You must be signed in to change notification settings - Fork 21
50 lines (44 loc) · 1.31 KB
/
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
49
50
name: deploy by helm
on:
workflow_call:
inputs:
helm_cmd_args:
required: true
type: string
kube_context:
required: true
type: string
environment_name:
required: true
type: string
secrets:
kube_config:
required: true
jobs:
deploy:
runs-on: self-hosted
env:
HELM_DEPLOYMENT_NAMESPACE_NAME: free5gc
HELM_CHART_RELEASE_NAME: eupf
HELM_CHART_APP_VERSION: ${{ github.sha }}
HELM_CHART_DIRECTORY: .deploy/helm/eupf
HELM_CMD_ARGS: ${{ inputs.helm_cmd_args }}
environment:
name: ${{ inputs.environment_name }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set Kubernetes Context
uses: azure/k8s-set-context@v3
with:
method: kubeconfig
context: ${{ inputs.kube_context }}
kubeconfig: ${{ secrets.kube_config }}
- name: Install helm
uses: azure/setup-helm@v3
with:
version: "v3.11.1"
- name: Install helm chart
run: |
sed -ie "s/appVersion.*$/appVersion\: \"$HELM_CHART_APP_VERSION\"/g" ${HELM_CHART_DIRECTORY}/Chart.yaml
helm upgrade --install ${HELM_CHART_RELEASE_NAME} ${HELM_CHART_DIRECTORY} --namespace ${HELM_DEPLOYMENT_NAMESPACE_NAME} ${HELM_CMD_ARGS}