An example workflow that uses GitHub Actions to build a static website into a container image tagged with the git sha, push that image to Amazon Elastic Container Registry, and deploy to Amazon EKS on using a simple Kubernetes Deployment and Service yaml with the image tag injected by Kustomize. An Ingress will create the needed ALB.
- Fork this repo.
- Create an EKS on Fargate cluster using the setup script:
bash eks-fargate-setup.sh
- Create an ECR repo called
example-eks
- On the Actions tab, enable GitHub Actions for the forked repo.
- Setup up the secrets and env vars mentioned below.
The following secrets are required to be set on the repository:
AWS_ACCESS_KEY_ID
: An AWS access key ID for an account having the EKS IAM roleAWS_SECRET_ACCESS_KEY
: An AWS secret sccess key for an account having the EKS IAM role
The following environment variables need to be set in the workflow:
- AWS_REGION: (e.g. eu-west-1)
- EKS_CLUSTER_NAME: (e.g. fantastic-party-9999999999)
You can optionally change the name of the ECR repo mentioned above in prereqs.
- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: example-eks
IMAGE_TAG: ${{ github.sha }}
We welcome contributions! See how to contribute.