Skip to content

chore: update wrong variables and keep name patterns #2

chore: update wrong variables and keep name patterns

chore: update wrong variables and keep name patterns #2

Workflow file for this run

name: Build and Deploy to EKS (Amazon)
on:
push:
branches:
- main
jobs:
setup-build-publish-deploy:
name: Setup, Build, Publish, and Deploy
# Should deploy?
if: ${{ vars.DEPLOY_TO_EKS == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Configure AWS credentials
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-session-token: ${{ secrets.AWS_SESSION_TOKEN }}
aws-region: us-east-1
- name: Update kube config
run: aws eks update-kubeconfig --name carlohcs-k8s-cluster --region us-east-1
- name: Login to DockerHub
run: docker login -u carlohcs -p ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
run: |
docker build -t carlohcs/kubernetes-ci-cd-github-actions .
docker push carlohcs/kubernetes-ci-cd-github-actions
- name: Deploy to EKS
run: |
kubectl apply -f k8s/node-deployment.yaml
kubectl apply -f k8s/node-service.yaml