Skip to content

Commit 618830c

Browse files
author
Hervé Lee
committed
add architectures and runtimes parameters
1 parent ccfd358 commit 618830c

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ inputs:
1919
description: Path to the code.
2020
required: false
2121
default: './'
22+
architectures:
23+
description: Target architectures
24+
required: false
25+
default: 'x86_64'
26+
runtimes:
27+
description: Compatible runtimes in space-separated string
28+
required: true
2229
runs:
2330
using: 'docker'
2431
image: 'Dockerfile'
@@ -28,6 +35,8 @@ runs:
2835
- ${{ inputs.lambda_function_name }}
2936
- ${{ inputs.code_path }}
3037
- ${{ inputs.s3_bucket }}
38+
- ${{ inputs.architectures }}
39+
- ${{ inputs.runtimes }}
3140
branding:
3241
icon: 'layers'
3342
color: 'yellow'

entrypoint.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ install_zip_dependencies(){
1212

1313
publish_dependencies_as_layer(){
1414
echo "Publishing dependencies as a layer..."
15-
local result=$(aws lambda publish-layer-version --layer-name "${INPUT_LAMBDA_LAYER_ARN}" --zip-file fileb://dependencies.zip)
15+
local result=$(aws lambda publish-layer-version --layer-name "${INPUT_LAMBDA_LAYER_ARN}" --compatible-runtimes "${INPUT_RUNTIMES}" --compatible-architectures "${INPUT_ARCHITECTURES}" --zip-file fileb://dependencies.zip)
1616
LAYER_VERSION=$(jq '.Version' <<< "$result")
1717
rm -rf python
1818
rm dependencies.zip
@@ -22,12 +22,12 @@ publish_function_code(){
2222
echo "Deploying the code itself..."
2323
zip -r code.zip . -x \*.git\*
2424
aws s3 cp code.zip s3://${INPUT_S3_BUCKET}/${INPUT_LAMBDA_FUNCTION_NAME}.zip
25-
aws lambda update-function-code --function-name "${INPUT_LAMBDA_FUNCTION_NAME}" --zip-file fileb://code.zip
25+
aws lambda update-function-code --architectures "${INPUT_ARCHITECTURES}" --function-name "${INPUT_LAMBDA_FUNCTION_NAME}" --zip-file fileb://code.zip
2626
}
2727

2828
update_function_layers(){
2929
echo "Using the layer in the function..."
30-
aws lambda update-function-configuration --function-name "${INPUT_LAMBDA_FUNCTION_NAME}" --layers "${INPUT_LAMBDA_LAYER_ARN}:${LAYER_VERSION}"
30+
aws lambda update-function-configuration --function-name "${INPUT_LAMBDA_FUNCTION_NAME}" --runtime "${INPUT_RUNTIMES%% *}" --layers "${INPUT_LAMBDA_LAYER_ARN}:${LAYER_VERSION}"
3131
}
3232

3333
deploy_lambda_function(){

0 commit comments

Comments
 (0)