test pipeline #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI-CD | |
on: | |
push: | |
branches: | |
- feat/pipeline | |
workflow_dispatch: | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
steps: | |
# Fazer checkout do código | |
- name: Checkout do código | |
uses: actions/checkout@v4 | |
# Fazer login no Docker Hub | |
- name: Docker Login | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
# Construir e enviar a imagem Docker | |
- name: Build and Push Docker Image | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: | | |
rafallltm/giropops-senhas:latest | |
rafallltm/giropops-senhas:2.${{ github.run_number }} | |
cd: | |
runs-on: ubuntu-latest | |
needs: ci | |
permissions: | |
id-token: write | |
contents: read | |
actions: read | |
steps: | |
# Fazer checkout do código | |
- name: Checkout do codigo | |
uses: actions/checkout@v4 | |
# Autenticar na AWS | |
- name: Autenticar na AWS | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-east-1 | |
# Atualizar kubeconfig | |
- name: Configurar kubectl | |
run: aws eks update-kubeconfig --name k8s-aws | |
# Deploy no Kubernetes | |
- name: Deploy to Kubernetes | |
uses: Azure/k8s-deploy@v5 | |
with: | |
manifests: | | |
./k8s/app-deployment.yaml | |
./k8s/redis-deployment.yaml | |
images: | | |
rafallltm/giropops-senhas:2.${{ github.run_number }} |