-
Notifications
You must be signed in to change notification settings - Fork 4
57 lines (49 loc) · 1.59 KB
/
deploy_template.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
51
52
53
54
55
56
57
name: Deploy to Kubernetes
on:
workflow_call:
inputs:
environment:
required: true
type: string
namespace:
required: true
type: string
project_folder:
required: true
type: string
secrets:
CONNECTIONSTRINGS__EVENTSTORE:
required: true
CONNECTIONSTRINGS__RABBITMQ:
required: true
KUBE_CONFIG:
required: true
jobs:
deploy:
runs-on: self-hosted
environment: ${{ inputs.environment }}
env:
CONNECTIONSTRINGS__EVENTSTORE: ${{ secrets.CONNECTIONSTRINGS__EVENTSTORE }}
CONNECTIONSTRINGS__RABBITMQ: ${{ secrets.CONNECTIONSTRINGS__RABBITMQ }}
steps:
- uses: actions/checkout@v4
- name: Download release artifacts
uses: actions/download-artifact@v4
with:
name: release-artifacts
path: ${{ inputs.project_folder }}/deploy/
- uses: helmfile/[email protected]
with:
helmfile-version: 'v0.156.0'
- name: Deploy to Kubernetes
working-directory: ${{ inputs.project_folder }}
run: |
helmfile init --force
sed -i "s/[$]namespace[$]/${{ inputs.namespace }}/g" deploy/helmfile.yaml
echo -e "\e[92mConfiguring kubernetes access in pipeline...\e[0m"
mkdir -p $(pwd)/.kube
echo ${{ secrets.KUBE_CONFIG }} | base64 -d > $(pwd)/.kube/config
export KUBECONFIG=$(pwd)/.kube/config
echo -e "\e[92mDeploying to ${{ inputs.environment }} environment...\e[0m"
cd deploy
helmfile --color -e ${{ inputs.namespace }} apply --set image.imagePullPolicy=Always