Skip to content

Commit

Permalink
kubernetes-resume-challenge
Browse files Browse the repository at this point in the history
  • Loading branch information
TomiwaAribisala-git committed Mar 22, 2024
1 parent 785648c commit 4d55c63
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,43 @@ jobs:
- name: Terraform Destroy
run: terraform destroy --auto-approve -no-color

kubernetes:
needs: terraform
name: "deploy to eks"
runs-on: ubuntu-latest
env:
EKS_CLUSTER_NAME: ecommerce-app-cluster
AWS_REGION: eu-north-1
defaults:
run:
working-directory: ./kubernetes
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
working-directory: ./kubernetes
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{env.AWS_REGION}}

- name: Update kube config
run: aws eks update-kubeconfig --name $EKS_CLUSTER_NAME --region $AWS_REGION

- name: Create secret to pull image
run: kubectl create secret docker-registry regcred --docker-server=docker.io --docker-username=${{ secrets.DOCKERHUB_USERNAME }} --docker-password=${{ secrets.DOCKERHUB_TOKEN }}

- name: Deploy To EKS
run: |
kubectl apply -f mariadb-secret.yml
kubectl apply -f mariadb-configmap.yml
kubectl apply -f mariadb.yml
kubectl apply -f mariadb-svc.yml
kubectl apply -f ecom-web-configmap.yml
kubectl apply -f ecom-web-config.yml
kubectl apply -f ecom-web.yml
kubectl apply -f ecom-web-svc.yml

0 comments on commit 4d55c63

Please sign in to comment.