|
| 1 | +# REAN Platform Deployment Workflows |
| 2 | + |
| 3 | +## PR-CI-CD |
| 4 | + |
| 5 | +**Mode of Trigger:** Automated |
| 6 | + |
| 7 | +The PR Workflow is triggered automatically whenever a Pull Request with a source branch as a `feature/*` branch is created against the target branch as the `develop` branch. |
| 8 | + |
| 9 | +### PR Workflow Diagram |
| 10 | + |
| 11 | + |
| 12 | +### GitHub Action Workflow Run |
| 13 | + |
| 14 | + |
| 15 | +### Jobs |
| 16 | + |
| 17 | +The PR workflow employs two jobs: |
| 18 | + |
| 19 | +#### CodeScan-ESLint |
| 20 | +In this job, we analyze the code that the developer wrote against certain rules to identify any stylistic or programmatic errors. |
| 21 | +* This job uses the [Super-linter](https://github.com/marketplace/actions/super-linter) action. |
| 22 | +* It utilizes a static code analysis tool to detect problematic patterns within the application's source code. |
| 23 | + |
| 24 | +#### Build-Docker-Image |
| 25 | +In this job, we validate the Dockerfile and test the image build process to uncover any issues arising from recent code changes. |
| 26 | +* This job uses [docker/build-push-action](https://github.com/marketplace/actions/build-and-push-docker-images). |
| 27 | +* It generates a Docker image with an image tag using the branch name and the short SHA of the commit, such as `feature/test_5e38e33`. |
| 28 | + |
| 29 | +## Dev-CI-CD |
| 30 | + |
| 31 | +**Mode of Trigger:** Automated |
| 32 | + |
| 33 | +The Dev Workflow is automatically initiated whenever a Pull Request is merged into the `develop` branch. This workflow encompasses building the applications and deploying the changes to the RF Platform Development environment. |
| 34 | + |
| 35 | +### Dev Workflow Diagram |
| 36 | + |
| 37 | + |
| 38 | +### GitHub Action Workflow Run |
| 39 | + |
| 40 | + |
| 41 | +### Jobs |
| 42 | + |
| 43 | +#### Deploy-ECS |
| 44 | +The Deploy ECS job encompasses the following steps: |
| 45 | + |
| 46 | +* It utilizes [docker/build-push-action](https://github.com/marketplace/actions/build-and-push-docker-images). |
| 47 | +* This job functions within the 'dev' environment and logs into ECR using credentials. It then constructs a new ECR Docker image with an image tag derived from the branch name and the short SHA of the commit. For instance, `/careplan-service-dev-uat:develop_5e38e33`. |
| 48 | +* Subsequently, the job generates a fresh version of the Amazon ECS task definition, integrating the new Docker image. The deployment of the Amazon ECS task definition is orchestrated using the Duplo API. |
| 49 | + |
| 50 | +## UAT-CI-CD |
| 51 | + |
| 52 | +**Mode of Trigger:** Automated |
| 53 | + |
| 54 | +The UAT-CI-CD workflow can be activated through two methods: |
| 55 | + |
| 56 | +1. Creating a Pull Request to merge into the `MAIN` branch. |
| 57 | +2. Initiating a Pull Request from a branch prefixed with 'release/'. |
| 58 | + |
| 59 | +### UAT Workflow Diagram |
| 60 | + |
| 61 | + |
| 62 | +### GitHub Action Workflow Run |
| 63 | + |
| 64 | + |
| 65 | +### Jobs |
| 66 | + |
| 67 | +#### CodeScan-ESLint |
| 68 | +The CodeScan ESLint job executes the following steps: |
| 69 | + |
| 70 | +* It employs the [Super-linter](https://github.com/marketplace/actions/super-linter) action. |
| 71 | +* Utilizing a static code analysis tool, this job identifies problematic patterns present in the application's source code. |
| 72 | + |
| 73 | +#### Label_Checks |
| 74 | +The Label Checks job performs the subsequent actions: |
| 75 | + |
| 76 | +* It leverages [pull-request-label-checker](https://github.com/marketplace/actions/label-checker-for-pull-requests). |
| 77 | +* Upon a Pull Request event, the job assesses whether the Pull Request bears one of the major, minor, or patch labels. |
| 78 | + |
| 79 | +#### Deploy-ECS |
| 80 | +The Deploy ECS job encompasses the ensuing steps: |
| 81 | + |
| 82 | +* It employs [docker/build-push-action](https://github.com/marketplace/actions/build-and-push-docker-images). |
| 83 | +* This job operates within the 'UAT' environment and authenticates to ECR using credentials. It proceeds to build a fresh ECR Docker image accompanied by an image tag derived from the branch name and the short SHA of the commit, such as `/careplan-service-dev-uat:develop_5e38e33`. |
| 84 | +* Subsequently, the job generates a new version of the Amazon ECS task definition, incorporating the updated Docker image. The deployment of the Amazon ECS task definition is facilitated using the Duplo API. |
| 85 | + |
| 86 | +## PROD-CI-CD |
| 87 | + |
| 88 | +**Mode of Trigger:** Automated |
| 89 | + |
| 90 | +The Prod Workflow is automatically initiated whenever a Pull Request is merged into the main branch. This workflow encompasses building the applications and deploying the changes to the RF Platform Production environment. |
| 91 | + |
| 92 | +### Prod Workflow Diagram |
| 93 | + |
| 94 | + |
| 95 | +### GitHub Action Workflow Run |
| 96 | + |
| 97 | + |
| 98 | +### Jobs |
| 99 | + |
| 100 | +#### Publish-Release |
| 101 | +The Publish-Release job undertakes the ensuing actions: |
| 102 | + |
| 103 | +* It utilizes [release-drafter](https://github.com/release-drafter/release-drafter). |
| 104 | +* This job generates a new GitHub release, with the versioning based on the label assigned by the developer to the pull request. |
| 105 | + |
| 106 | +#### Deploy-ECS |
| 107 | +The Deploy-ECS job encompasses the following steps: |
| 108 | + |
| 109 | +* It employs [docker/build-push-action](https://github.com/marketplace/actions/build-and-push-docker-images). |
| 110 | +* This job authenticates to ECR using credentials and assembles a new ECR Docker image accompanied by an image tag based on the ID of the release generated by the Publish-Release job. For instance, `careplan-service-dev-uat:97777323`. |
| 111 | +* Subsequently, the job produces a new version of the Amazon ECS task definition, integrating the updated Docker image. The deployment of the Amazon ECS task definition is facilitated using the Duplo API. |
0 commit comments