-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from AOT-Technologies/case-flow-cd-aws
Updated git actions to deploy in aws environment of caseflow
- Loading branch information
Showing
5 changed files
with
219 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Caseflow Core CD - AWS | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
ecr: | ||
required: true | ||
version: | ||
required: true | ||
reponame: | ||
required: true | ||
default: caseflow_web | ||
jobs: | ||
build: | ||
name: Build Image | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ca-central-1 | ||
|
||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v1 | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: ./app/caseflow_core/microservices/server | ||
push: true | ||
tags: ${{ github.event.inputs.ecr }}/${{ github.event.inputs.reponame }}:${{ github.event.inputs.version }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Caseflow Gateway - CD AWS | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
ecr: | ||
required: true | ||
version: | ||
required: true | ||
reponame: | ||
required: true | ||
default: caseflow_gateway | ||
jobs: | ||
build: | ||
name: Build Image | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ca-central-1 | ||
|
||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v1 | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: ./app/caseflow_core/microservices/gateway | ||
push: true | ||
tags: ${{ github.event.inputs.ecr }}/${{ github.event.inputs.reponame }}:${{ github.event.inputs.version }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Caseflow LOB CD - AWS | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
ecr: | ||
required: true | ||
version: | ||
required: true | ||
reponame: | ||
required: true | ||
default: caseflow_lob | ||
jobs: | ||
build: | ||
name: Build Image | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ca-central-1 | ||
|
||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v1 | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: ./app/caseflow_core/microservices/lob | ||
push: true | ||
tags: ${{ github.event.inputs.ecr }}/${{ github.event.inputs.reponame }}:${{ github.event.inputs.version }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Caseflow DMS CD - AWS | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
ecr: | ||
required: true | ||
version: | ||
required: true | ||
reponame: | ||
required: true | ||
default: caseflow_microservice | ||
jobs: | ||
build: | ||
name: Build Image | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ca-central-1 | ||
|
||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v1 | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: ./app/caseflow_core/microservices/dms | ||
push: true | ||
tags: ${{ github.event.inputs.ecr }}/${{ github.event.inputs.reponame }}:${{ github.event.inputs.version }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Caseflow Web CD - AWS | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
ecr: | ||
required: true | ||
version: | ||
required: true | ||
reponame: | ||
required: true | ||
jobs: | ||
build: | ||
name: Build Image | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [14.x] | ||
|
||
steps: | ||
|
||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
cache-dependency-path: "./app/caseflow_web/package-lock.json" | ||
- run: npm install --force | ||
working-directory: ./app/caseflow_web | ||
- run: CI=false npm run build | ||
working-directory: ./app/caseflow_web | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ca-central-1 | ||
|
||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v1 | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: ./app/caseflow_web | ||
push: true | ||
tags: ${{ github.event.inputs.ecr }}/${{ github.event.inputs.reponame }}:${{ github.event.inputs.version }} | ||
|
||
- name: Fill in the new image ID in the Amazon ECS task definition | ||
id: task-def | ||
uses: aws-actions/amazon-ecs-render-task-definition@v1 | ||
with: | ||
task-definition: caseflow_web.json | ||
container-name: caseflow_web | ||
image: ${{ github.event.inputs.ecr }}/${{ github.event.inputs.reponame }}:${{ github.event.inputs.version }} | ||
|
||
- name: Deploy Amazon ECS task definition | ||
uses: aws-actions/amazon-ecs-deploy-task-definition@v1 | ||
with: | ||
task-definition: ${{ steps.task-def.outputs.task-definition }} | ||
service: caseflow_web | ||
cluster: caseflow | ||
wait-for-service-stability: true |