-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (90 loc) · 2.62 KB
/
deploy-with-helm.yaml
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Release service with helm.
on:
workflow_call:
inputs:
runs-on:
required: true
description: Platform to execute on
type: string
helm-repo-path:
required: true
type: string
helm-release:
required: true
type: string
namespace:
required: true
type: string
send_notification_to_slack:
required: false
type: boolean
default: false
tag:
required: true
type: string
first-tag-name:
required: false
type: string
default: image.tag
second-tag-name:
required: false
type: string
default: global.image.tag
environment:
required: true
type: string
secrets:
TRIGGER_GITHUB_TOKEN:
required: true
HELM_VERSION:
required: true
KUBECTL_VERSION:
required: true
K8S_DEPLOYMENT_CONFIGS_REPOSITORY:
required: true
SLACK_WEBHOOK:
required: false
jobs:
deploy:
name: Upgrade service with helm.
runs-on: ${{ fromJSON(inputs.runs-on) }}
steps:
- uses: actions/checkout@v3
with:
repository: ${{ secrets.K8S_DEPLOYMENT_CONFIGS_REPOSITORY }}
token: ${{ secrets.TRIGGER_GITHUB_TOKEN }}
- uses: azure/setup-helm@v3
with:
version: ${{ secrets.HELM_VERSION }}
- uses: azure/setup-kubectl@v3
with:
version: ${{ secrets.KUBECTL_VERSION }}
- name: Deploy
env:
HELM_RELEASE: ${{ inputs.helm-release }}
HELM_REPO_PATH: ${{ inputs.helm-repo-path }}
NAMESPACE: ${{ inputs.namespace }}
ENVIRONMENT: ${{ inputs.environment }}
TAG: ${{ inputs.tag }}
FIRST_TAG_NAME: ${{ inputs.first-tag-name }}
SECOND_TAG_NAME: ${{ inputs.second-tag-name }}
run: |
helm upgrade --install ${HELM_RELEASE} ${HELM_REPO_PATH} \
-f ${HELM_REPO_PATH}/envs/${ENVIRONMENT}.yaml \
--set ${FIRST_TAG_NAME}=${TAG} \
--set ${SECOND_TAG_NAME}=${TAG} \
--debug --atomic --cleanup-on-fail \
--timeout 10m \
-n ${NAMESPACE}
slack_notify:
if: ${{ inputs.send_notification_to_slack }}
needs: deploy
name: Send notification to slack
runs-on: ubuntu-latest
steps:
- uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_USERNAME: 'GITHUB_ACTIONS'
SLACK_ICON: 'https://github.com/cere-io/reusable-workflows/raw/master/Documentation/logo.png'
SLACK_FOOTER: ''