chore: Update GKE credentials setup and location in gc.yaml #1
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: Build and Deploy to EKS (Amazon) | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
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@v2 | |
- 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 |