forked from badtuxx/giropops-senhas
-
-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (55 loc) · 1.85 KB
/
deploy-helm-chart.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
name: Deploy Helm Chart
on:
push:
branches:
- main # Branch usada para deploys
jobs:
deploy:
runs-on: ubuntu-latest
steps:
# Passo 1: Checkout do código
- name: Checkout code
uses: actions/checkout@v3
# Passo 2: Clonar o repositório com Helm Charts
- name: Clone Helm Charts Repository
env:
GH_USERNAME: ${{ secrets.GH_USERNAME }}
GH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: |
git clone https://$GH_USERNAME:$GH_TOKEN@github.com/nataliagranato/senhas.git
# Passo 3: Instalar kubectl
- name: Install kubectl
uses: azure/setup-kubectl@v4
with:
version: 'latest'
# Passo 4: Configurar a conexão com o cluster Kubernetes
- name: Configure Kubernetes context
env:
KUBECONFIG: ${{ secrets.KUBECONFIG }}
run: |
echo "$KUBECONFIG" | base64 --decode > kubeconfig
export KUBECONFIG=$(pwd)/kubeconfig
kubectl get nodes
# # Passo 5: Instalar Helm
# - name: Install Helm
# uses: azure/setup-helm@v1
# with:
# version: 'latest'
# # Passo 6: Criar namespaces se não existirem
# - name: Create namespaces
# env:
# KUBECONFIG: ${{ secrets.KUBECONFIG }}
# run: |
# echo "$KUBECONFIG" | base64 --decode > kubeconfig
# export KUBECONFIG=$(pwd)/kubeconfig
# kubectl create namespace giropops-senhas-prd || true
# kubectl create namespace giropops-senhas-dev || true
# kubectl create namespace giropops-senhas-stg || true
# - name: Deploy Helm Chart to Production
# env:
# KUBECONFIG: ${{ secrets.KUBECONFIG }}
# run: |
# cd /senhas/charts/senhas
# echo "$KUBECONFIG" | base64 --decode > kubeconfig
# export KUBECONFIG=$(pwd)/kubeconfig
# helm upgrade -i giropops-senhas -n giropops-senhas-prd .