GitOps! Deploy a simple nginx website to AWS EKS using Terraform and HELM, all triggered by GitHub Actions
How to use:
- Create secrets in the github projects settings page (/secrets/Actions) see info below
- git checkout -b new_branch
- Edit (./docker/index.html) (not needed on the first run)
- git add -A , git Push
- Create a Pull Request
- Github actions will start (/.github/workflows/plan-on-pr.yaml) and run terraform plan
- Examine plan
- Approve the Pull Request and merge to main
- Github action will start (/.github/workflows/apply-on-merge.yaml) and do the following actions:
- init AWS, terraform
- build a docker file using ./docker/Dockerfile
- upload it to Docker HUB
- Run terraform apply to provision AWS EKS
- deploy the helm chart to kubernetes
Repository secrets needed:
- ALLOWED_ACCOUNT_ID - AWS account ID
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- DOCKER_USER - Docker hub free account
- DOCKER_PASSWORD