File tree 2 files changed +70
-1
lines changed
2 files changed +70
-1
lines changed Original file line number Diff line number Diff line change
1
+ name : CI-CD
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - feat/pipeline
7
+ workflow_dispatch :
8
+
9
+ jobs :
10
+ ci :
11
+ runs-on : ubuntu-latest
12
+
13
+ steps :
14
+ # Fazer checkout do código
15
+ - name : Checkout do código
16
+ uses : actions/checkout@v4
17
+
18
+ # Fazer login no Docker Hub
19
+ - name : Docker Login
20
+ uses : docker/login-action@v3
21
+ with :
22
+ username : ${{ secrets.DOCKER_USERNAME }}
23
+ password : ${{ secrets.DOCKER_TOKEN }}
24
+
25
+ # Construir e enviar a imagem Docker
26
+ - name : Build and Push Docker Image
27
+ uses : docker/build-push-action@v6
28
+ with :
29
+ context : .
30
+ file : ./Dockerfile
31
+ push : true
32
+ tags : |
33
+ rafallltm/giropops-senhas:latest
34
+ rafallltm/giropops-senhas:2.${{ github.run_number }}
35
+
36
+ cd :
37
+ runs-on : ubuntu-latest
38
+ needs : ci
39
+ permissions :
40
+ id-token : write
41
+ contents : read
42
+ actions : read
43
+
44
+ steps :
45
+ # Fazer checkout do código
46
+ - name : Checkout do codigo
47
+ uses : actions/checkout@v4
48
+
49
+ # Autenticar na AWS
50
+ - name : Autenticar na AWS
51
+ uses : aws-actions/configure-aws-credentials@v1
52
+ with :
53
+ aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }}
54
+ aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
55
+ aws-region : us-east-1
56
+
57
+ # Atualizar kubeconfig
58
+ - name : Configurar kubectl
59
+ run : aws eks update-kubeconfig --name k8s-aws
60
+
61
+ # Deploy no Kubernetes
62
+ - name : Deploy to Kubernetes
63
+ uses : Azure/k8s-deploy@v5
64
+ with :
65
+ manifests : |
66
+ ./k8s/app-deployment.yaml
67
+ ./k8s/redis-deployment.yaml
68
+ images : |
69
+ rafallltm/giropops-senhas:2.${{ github.run_number }}
Original file line number Diff line number Diff line change 54
54
- protocol : TCP
55
55
port : 5000
56
56
targetPort : 5000
57
- type : ClusterIP
57
+ type : LoadBalancer
You can’t perform that action at this time.
0 commit comments