Skip to content

Commit eb2437e

Browse files
GitHub action to automate redeployment of ECS container in staging
1 parent 7028a60 commit eb2437e

File tree

3 files changed

+40
-8
lines changed

3 files changed

+40
-8
lines changed

.github/workflows/run-checks.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ name: Lint, Format, Test, Build
33
on:
44
push:
55
branches:
6-
- "*"
7-
- "!main"
8-
- "!develop"
6+
- '*'
7+
- '!main'
8+
- '!develop'
99
workflow_dispatch:
1010

1111
jobs:
@@ -19,7 +19,7 @@ jobs:
1919
uses: actions/setup-node@v4
2020
with:
2121
node-version: 23
22-
cache: "npm"
22+
cache: 'npm'
2323

2424
- name: Install Node.js packages
2525
run: npm ci
@@ -34,7 +34,7 @@ jobs:
3434
uses: actions/setup-node@v4
3535
with:
3636
node-version: 23
37-
cache: "npm"
37+
cache: 'npm'
3838

3939
- name: Install Node.js packages
4040
run: npm ci
@@ -52,7 +52,7 @@ jobs:
5252
uses: actions/setup-node@v4
5353
with:
5454
node-version: 23
55-
cache: "npm"
55+
cache: 'npm'
5656

5757
- name: Install Node.js packages
5858
run: npm ci
@@ -70,7 +70,7 @@ jobs:
7070
uses: actions/setup-node@v4
7171
with:
7272
node-version: 23
73-
cache: "npm"
73+
cache: 'npm'
7474

7575
- name: Install Node.js packages
7676
run: npm ci
@@ -90,7 +90,7 @@ jobs:
9090
uses: actions/setup-node@v4
9191
with:
9292
node-version: 23
93-
cache: "npm"
93+
cache: 'npm'
9494

9595
- name: Install Node.js packages
9696
run: npm ci
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Redeploy ECS container in STAGING
2+
3+
permissions:
4+
id-token: write # Required for OIDC authentication
5+
contents: read # Standard permission for GitHub Actions
6+
7+
on:
8+
workflow_run:
9+
workflows: ['Publish STAGING image']
10+
types:
11+
- completed
12+
13+
jobs:
14+
deploy:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Configure AWS Credentials
21+
uses: aws-actions/configure-aws-credentials@v4
22+
with:
23+
role-to-assume: ${{ vars.AWS_STAGING_ECS_REDEPLOY_ROLE_ARN }}
24+
aws-region: ${{ vars.AWS_STAGING_REGION }}
25+
26+
- name: Update ECS Service
27+
run: |
28+
aws ecs update-service \
29+
--cluster ${{ vars.AWS_STAGING_ECS_CLUSTER }} \
30+
--service ${{ vars.AWS_STAGING_ECS_SERVICE }} \
31+
--force-new-deployment

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,3 +205,4 @@ certificates
205205
notes.md
206206

207207
.VSCodeCounter
208+
*~

0 commit comments

Comments
 (0)