-
Notifications
You must be signed in to change notification settings - Fork 3
86 lines (78 loc) · 2.66 KB
/
deploy-app.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Deploy App
on:
workflow_call:
inputs:
version:
description: 'The ECR tag to deploy'
type: string
required: true
image-name:
description: 'The name of the image to deploy'
type: string
default: ${{ vars.IMAGE_NAME }}
task-name:
description: 'The name of the service to deploy, used to build cluster/service/task names'
type: string
default: ${{ vars.IMAGE_NAME }}
stage:
description: 'The environment to deploy to'
type: string
required: true
stage-url:
description: 'The URL of the environment'
type: string
required: true
aws-region:
description: 'The AWS region to deploy to'
type: string
default: ${{ vars.AWS_REGION }}
aws-role-arn:
description: 'The ARN of the AWS role to assume for the deployment'
type: string
required: true
run-label:
description: 'The run label to use for the actions'
type: string
default: 'ubuntu-latest'
concurrency: deploy-${{ inputs.stage }}
permissions:
contents: read
id-token: write
jobs:
deploy-app:
name: Deploy App `${{ inputs.stage }}`
runs-on: ${{ inputs.run-label }}
environment:
name: ${{ inputs.stage }}
url: ${{ inputs.stage-url }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.PRIVATE_SUBMODULE_ACCESS_TOKEN || github.token }}
submodules: recursive
- name: Build Task Name
id: build_task_name
uses: WalletConnect/ci_workflows/.github/actions/build-task-name@main
with:
task-region: ${{ inputs.aws-region }}
task-name-stage: ${{ inputs.stage }}
task-name: ${{ inputs.task-name }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ inputs.aws-role-arn }}
aws-region: ${{ inputs.aws-region }}
- name: Login to ECR repository
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Deploy image to ECS
id: deploy
uses: WalletConnect/actions/aws/ecs/deploy-image/@2.5.3
with:
aws-role-arn: ${{ inputs.aws-role-arn }}
aws-region: ${{ inputs.aws-region }}
cluster-name: ${{ steps.build_task_name.outputs.name }}-cluster
service-name: ${{ steps.build_task_name.outputs.name }}-service
task-definition-name: ${{ steps.build_task_name.outputs.name }}
image-name: ${{ steps.login-ecr.outputs.registry }}/${{ inputs.image-name }}:${{ inputs.version }}