Skip to content

Update _build_flag

Update _build_flag #11

name: 'Provision EKS and Deploy Juice Shop'
on:
push:
branches:
- master
paths:
- '_build_flag'
jobs:
provision-eks:
name: 'Deploy Terraform'
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
with:
terraform_wrapper: false
- name: Install kubectl
run: |
curl -LO https://dl.k8s.io/release/v1.29.2/bin/linux/amd64/kubectl
chmod +x kubectl
mkdir -p ~/.local/bin
mv ./kubectl ~/.local/bin/kubectl
kubectl version --client
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Terraform Init
run: terraform -chdir=terraform init
- name: Terraform Apply
run: terraform -chdir=terraform apply -auto-approve
- name: kubectl apply
run: |
aws eks update-kubeconfig --region us-east-1 --name juice-shop-cluster
kubectl apply -f k8s-src