Skip to content

Commit 5c500da

Browse files
committed
test pipeline
1 parent ce3f926 commit 5c500da

File tree

2 files changed

+70
-1
lines changed

2 files changed

+70
-1
lines changed

.github/workflows/main.yml

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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 }}

k8s/app-deployment.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ spec:
5454
- protocol: TCP
5555
port: 5000
5656
targetPort: 5000
57-
type: ClusterIP
57+
type: LoadBalancer

0 commit comments

Comments
 (0)