-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (38 loc) · 1.06 KB
/
prod_CD.yaml
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
name: prod_CD
on:
push:
branches:
- main
paths-ignore:
- 'README.md'
workflow_dispatch:
permissions:
id-token: write
contents: read
env:
LAMBDA: resize-image
jobs:
upload_zip_to_lambda:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Make zip
run: |
cd src
sed -i "s/BUCKET_NAME/${{ secrets.PROD_BUCKET_NAME }}/gi" index.js
docker build --tag sharp_on_lambda:nodejs14 .
docker run --name sharp_on_lambda_container sharp_on_lambda:nodejs14
docker cp sharp_on_lambda_container:/lambda.zip .
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::134510465097:role/GitHubActions
aws-region: ap-northeast-2
- name: Upload AWS
run: |
cd src
aws lambda update-function-code \
--region us-east-1 \
--function-name ${{ env.LAMBDA }} \
--zip-file fileb://lambda.zip