-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdeploy_function_code_to_prod.yml
More file actions
71 lines (54 loc) · 2.36 KB
/
Copy pathdeploy_function_code_to_prod.yml
File metadata and controls
71 lines (54 loc) · 2.36 KB
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
name: Deploy Function Code to Prod
on:
push:
tags:
- prd-*
workflow_dispatch:
permissions:
contents: read
id-token: write
jobs:
build:
name: Build function code
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build function code
run: ./build-s3-dist.sh solutions stocktwits-resizing v1.0.4
working-directory: deployment
- name: Cache built function code
uses: actions/upload-artifact@v3
with:
name: image-handler.zip
path: deployment/regional-s3-assets/image-handler.zip
deploy:
name: Deploy function code
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Retrieve built function code
uses: actions/download-artifact@v3
with:
name: image-handler.zip
- name: Configure AWS credentials for prod AWS account
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: us-east-1
role-to-assume: arn:aws:iam::455897087921:role/StocktwitsServerlessImageHandlerGithub
role-session-name: GithubActions
- name: Deploy function code for st-avatars bucket
run: aws lambda update-function-code --function-name sih-st-avatars-BackEndImageHandlerLambdaFunctionAD-Qter5t39foF9 --zip-file fileb://`pwd`/image-handler.zip --publish
- name: Deploy function code for st-charts bucket
run: aws lambda update-function-code --function-name sih-st-charts-BackEndImageHandlerLambdaFunctionADE-mJmhSaFcJHVZ --zip-file fileb://`pwd`/image-handler.zip --publish
- name: Configure AWS credentials for "old" AWS account
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: us-east-1
role-to-assume: arn:aws:iam::146390941810:role/StocktwitsServerlessImageHandlerGithub
role-session-name: GithubActions
- name: Deploy function code for st-avatars bucket
run: aws lambda update-function-code --function-name sih-st-avatars-old-accoun-BackEndImageHandlerLambd-WLhOD4vNRmwT --zip-file fileb://`pwd`/image-handler.zip --publish
- name: Deploy function code for st-charts bucket
run: aws lambda update-function-code --function-name sih-st-charts-old-account-BackEndImageHandlerLambd-Krbyl9WMv7KQ --zip-file fileb://`pwd`/image-handler.zip --publish