Skip to content

Commit ec3cb3d

Browse files
committed
add upload to s3 step
1 parent d2ac60b commit ec3cb3d

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

.github/workflows/deploy-ecs-uat.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,4 @@ jobs:
4848
dd-rum-client-token: ${{ secrets.DD_RUM_CLIENT_TOKEN }}
4949
dd-sample-rate: ${{ secrets.DD_SAMPLE_RATE }}
5050
DD_API_KEY: ${{ secrets.DD_API_KEY }}
51+
S3_STATIC_ASSETS_BUCKET_NAME: ${{ secrets.S3_STATIC_ASSETS_BUCKET_NAME }}

.github/workflows/deploy-ecs.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ on:
102102
DD_API_KEY:
103103
description: 'Datadog API key'
104104
required: true
105+
S3_STATIC_ASSETS_BUCKET_NAME:
106+
description: 'S3 domain style bucket name for static assets'
107+
required: true
105108

106109
# used to configure IAM to trust Github's OIDC provider
107110
permissions:
@@ -176,6 +179,16 @@ jobs:
176179
secrets: |
177180
"dd_api_key=${{ secrets.DD_API_KEY }}"
178181
182+
- name: Copy Static Assets from Docker Image and Push to S3
183+
env:
184+
S3_STATIC_ASSETS_BUCKET_NAME: ${{ secrets.S3_STATIC_ASSETS_BUCKET_NAME }}
185+
ECR_REPOSITORY: ${{ inputs.ecr-repository }}
186+
run: |
187+
mkdir -p /tmp/s3static
188+
chmod 777 /tmp/s3static
189+
docker run --rm -v /tmp/s3static:/tmp/s3static $ECR_REPOSITORY:$IMAGE_TAG cp -r ./dist/frontend/. /tmp/s3static
190+
aws s3 sync /tmp/s3static s3://$S3_STATIC_ASSETS_BUCKET_NAME
191+
179192
- name: Replace variables in task definition file
180193
id: replace-variables
181194
run: |

0 commit comments

Comments
 (0)