Skip to content

Commit 19a288c

Browse files
authored
API deployment: use aliases (#1855)
1 parent 98d0416 commit 19a288c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.github/workflows/deploy-api-lambda.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,17 @@ jobs:
5252

5353
- name: Upload Lambda function
5454
run: |
55-
aws lambda update-function-code \
55+
NEW_VERSION=$(aws lambda update-function-code \
5656
--function-name "elastic-docs-v3-${ENVIRONMENT}-api" \
57-
--zip-file "fileb://${ZIP_FILE}"
57+
--zip-file "fileb://${ZIP_FILE}" \
58+
--publish \
59+
--query 'Version' \
60+
--output text)
61+
62+
aws lambda update-alias \
63+
--function-name "elastic-docs-v3-${ENVIRONMENT}-api" \
64+
--name live \
65+
--function-version $NEW_VERSION
66+
5867
env:
5968
ENVIRONMENT: ${{ inputs.environment }}

0 commit comments

Comments
 (0)