ci: enables deployment to AWS ECS [#59]#69
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the Phase 5 CD pipeline to
.github/workflows/main.ymlso merges tomaincan deploy the app to AWS ECS after the existing CI jobs succeed.This PR extends the current GitHub Actions workflow with a
deployjob that:pushtomainlint,test,docker-build, ande2e-dockerAWS_ROLE_ARNgithub.shacourse-enrollment-app-svcWhy this approach
The deployment uses immutable SHA image tags instead of reusing
latest.That gives us commit-to-runtime traceability and fits the current AWS setup, where the ECR repository was created with tag immutability enabled in Phase 1.
GitHub Actions configuration
This PR expects the following repo configuration:
Secret
AWS_ROLE_ARNVariables
AWS_REGIONECR_REGISTRYECR_REPOSITORYECS_CLUSTERECS_SERVICEThese values have already been added in GitHub repo settings.
AWS prerequisite
The GitHub Actions deploy role must be able to:
ECSTaskExecutionRole-CourseEnrollmentAppThe IAM policy for
GitHubActions-CourseEnrollmentAppwas updated to support this deploy flow.Validation
Ran locally:
pre-commit run --files .github/workflows/main.yml✅Confirmed in GitHub repo settings:
gh variable list --repo robert-7/course-enrollment-app✅gh secret list --repo robert-7/course-enrollment-app✅Post-merge validation
After merging this PR to
main, validate that:deployjob runs after the CI jobs passcourse-enrollment-app-svc/indexpath still returns HTTP 200Closes #59