Skip to content

Merge branch 'main' of github.com:lguima/imersao-devops-cloud-02 #12

Merge branch 'main' of github.com:lguima/imersao-devops-cloud-02

Merge branch 'main' of github.com:lguima/imersao-devops-cloud-02 #12

Workflow file for this run

name: CI-CD
on:
push:
branches: [ "main" ]
workflow_dispatch:
jobs:
CI:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Docker Login
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_REGISTRY_USER }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
- name: Build and push Docker images
uses: docker/[email protected]
with:
context: ./kube-news/src
file: ./kube-news/src/Dockerfile
push: true
tags: |
lucasguima/kube-news:0.3.${{ github.run_number }}
lucasguima/kube-news:latest
CD:
runs-on: ubuntu-latest
needs: [CI]
steps:
- name: Checkout
uses: actions/[email protected]
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ vars.AWS_REGION }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: KubeConfig setup
run: aws eks update-kubeconfig --name ${{ vars.AWS_EKS_CLUSTER_NAME }} --region ${{ vars.AWS_REGION }}
- name: Deploy to Kubernetes cluster
uses: Azure/[email protected]
with:
manifests: |
./kube-news/k8s/deployment.yaml
images: |
lucasguima/kube-news:0.3.${{ github.run_number }}