CI stands for "Continuous Integration" and CD stands for "Continuous Deployment".
The goal of CI/CD is to have a fully automated process of deploying new versions of AMY to a server. Currently it is only working for testing stage, but could be extended to production at some point, too.
During CI stage, the following happens:
- Code is pushed to GitHub.
- GitHub Actions runs tests.
- If tests pass, then a new Docker image is built and pushed to AWS Elastic Container Registry (ECR).
Then CD stage starts:
- A new version of AMY is deployed to testing stage.
The CI/CD pipeline is run by GitHub Actions. It
is defined in
develop branch) file.
Note that there is another workflow
.github/workflows/cicd_main.yml that is run only
main branch, but it doesn't contain any other steps (stages) than
There is a separate
test stage for CI/CD defined in
and included in the main
cicd_develop.yml file. It installs all the dependencies,
sets up database and runs tests.
build stage is defined in
.github/workflows/cicd_develop.yml file. After logging
in to AWS ECR, it builds a Docker image and pushes it to AWS ECR with last commit hash
as a image tag.
deploy stage is defined in
.github/workflows/cicd_develop.yml file. It is only
run when GitHub Actions is triggered by a push to
develop branch, either through
a PR merge or direct push.
Deployment uses an AWS Elastic Container Service (ECS)
task definition downloaded to a GitHub agent. Then this file has the image tag updated
to the one that was built in the
build stage. Then the task definition is uploaded to
AWS ECS and a new task is started.