-
Notifications
You must be signed in to change notification settings - Fork 0
153 lines (137 loc) · 5.45 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
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: Deploy
on:
workflow_call:
inputs:
github_environment:
description: The name of the github environment for deployment secrets/Namespace
type: string
required: true
environment:
description: The name of the environment to deploy to (dev/prod)
type: string
required: true
version:
description: The image version to deploy
type: string
required: true
workflow_dispatch:
inputs:
github_environment:
description: The name of the github environment for deployment secrets/Namespace
type: choice
required: true
options:
- development
- production
environment:
description: Environment
type: choice
required: true
options:
- dev
- prod
version:
description: Image version
type: string
required: true
jobs:
deploy:
runs-on: ubuntu-latest
strategy:
fail-fast: false
environment:
name: ${{ inputs.github_environment }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
# - name: Env details
# uses: ./.github/actions/get-env-details
# id: env
# with:
# environment: ${{ inputs.github_environment }}
# - name: Set Kubernetes Namespace secrets
# id: set_namespace_secrets
# run: |
# if [[ "${{ inputs.github_environment }}" == "development" ]]; then
# api=https://"{{ secrets.DEVELOPMENT_KUBE_CLUSTER }}"
# cert="${{ secrets.DEVELOPMENT_KUBE_CERT }}"
# cluster="${{ secrets.DEVELOPMENT_KUBE_CLUSTER }}"
# namespace="${{ secrets.DEVELOPMENT_KUBE_NAMESPACE }}"
# token="${{ secrets.DEVELOPMENT_KUBE_TOKEN }}"
# elif [[ "${{ inputs.github_environment }}" == "production" ]]; then
# api=https://"{{ secrets.PRODUCTION_KUBE_CLUSTER }}"
# cert="${{ secrets.PRODUCTION_KUBE_CERT }}"
# cluster="${{ secrets.PRODUCTION_KUBE_CLUSTER }}"
# namespace="${{ secrets.PRODUCTION_KUBE_NAMESPACE }}"
# token="${{ secrets.PRODUCTION_KUBE_TOKEN }}"
# else
# echo "Invalid Github environment/namespace specified: ${{ inputs.github_environment }}"
# exit 1
# fi
- name: Deploy to Dev
# if: ${{ steps.check_files.outputs.files_exists == 'true' && steps.enabled.outputs.enabled == 'true' }}
uses: ./.github/actions/cloud-platform-deploy
with:
environment: ${{ inputs.environment }}
version: ${{ inputs.version }}
api: https://${{ secrets.DEVELOPMENT_KUBE_CLUSTER }}
cert: ${{ secrets.DEVELOPMENT_KUBE_CERT }}
cluster: ${{ secrets.DEVELOPMENT_KUBE_CLUSTER }}
namespace: ${{ secrets.DEVELOPMENT_KUBE_NAMESPACE }}
token: ${{ secrets.DEVELOPMENT_KUBE_TOKEN }}
# - name: Set Kubernetes Namespace secrets
# id: set_namespace_secrets
# run: |
# if [[ "${{ inputs.github_environment }}" == "development" ]]; then
# api=https://"{{ secrets.DEVELOPMENT_KUBE_CLUSTER }}"
# cert="${{ secrets.DEVELOPMENT_KUBE_CERT }}"
# cluster="${{ secrets.DEVELOPMENT_KUBE_CLUSTER }}"
# namespace="${{ secrets.DEVELOPMENT_KUBE_NAMESPACE }}"
# token="${{ secrets.DEVELOPMENT_KUBE_TOKEN }}"
# elif [[ "${{ inputs.github_environment }}" == "production" ]]; then
# api=https://"{{ secrets.PRODUCTION_KUBE_CLUSTER }}"
# cert="${{ secrets.PRODUCTION_KUBE_CERT }}"
# cluster="${{ secrets.PRODUCTION_KUBE_CLUSTER }}"
# namespace="${{ secrets.PRODUCTION_KUBE_NAMESPACE }}"
# token="${{ secrets.PRODUCTION_KUBE_TOKEN }}"
# else
# echo "Invalid Github environment/namespace specified: ${{ inputs.github_environment }}"
# exit 1
# fi
- name: Deploy to Prod
# if: ${{ steps.check_files.outputs.files_exists == 'true' && steps.enabled.outputs.enabled == 'true' }}
uses: ./.github/actions/cloud-platform-deploy
with:
environment: ${{ inputs.github_environment }}
version: ${{ inputs.version }}
api: https://${{ secrets.PRODUCTION_KUBE_CLUSTER }}
cert: ${{ secrets.PRODUCTION_KUBE_CERT }}
cluster: ${{ secrets.PRODUCTION_KUBE_CLUSTER }}
namespace: ${{ secrets.PRODUCTION_KUBE_NAMESPACE }}
token: ${{ secrets.PRODUCTION_KUBE_TOKEN }}
# jobs:
# deploy:
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# environment:
# name: ${{ inputs.github_environment }}
# steps:
# - uses: actions/checkout@v3
# - uses: ./.github/actions/get-env-details
# id: env
# with:
# environment: ${{ inputs.environment }}
# - name: Set Kubernetes Namespace secrets
# id: set_namespace_secrets
# run: |
# case "${{ }}"
# uses: ./.github/actions/cloud-platform-deploy
# with:
# environment: ${{ inputs.environment }}
# version: ${{ inputs.version }}
# api: https://${{ secrets.DEVELOPMENT_KUBE_CLUSTER }}
# cert: ${{ secrets.DEVELOPMENT_KUBE_CERT }}
# cluster: ${{ secrets.DEVELOPMENT_KUBE_CLUSTER }}
# namespace: ${{ secrets.DEVELOPMENT_KUBE_NAMESPACE }}
# token: ${{ secrets.DEVELOPMENT_KUBE_TOKEN }}