Continuous Deployment of an application using Github Actions
- A cloud platform namespace
- An ECR in your namespace, to store your docker images
- A serviceaccount in your namespace
- Build your Docker image using the following command.
docker build -t cloud-platform/github-action-reference-app .
- After the build completes, tag your image so you can push the image to this repository:
docker tag cloud-platform/github-action-reference-app:latest 754256621582.dkr.ecr.eu-west-2.amazonaws.com/cloud-platform/github-action-reference-app:latest
- Run the following command to push this image to your newly created AWS repository:
docker push 754256621582.dkr.ecr.eu-west-2.amazonaws.com/cloud-platform/github-action-reference-app:latest
The serviceaccount has permissions to deploy to your namespace, so we will use its ca.crt and token in the pipeline. Guidence on Using your serviceaccount to authenticate to the cluster here
There are several ways to deploy applications onto the MoJ Cloud Platform, the below will show the - helm.
helm install github-action-reference-app . \
--values values.yaml \
--namespace <namespace-name>