Skip to content

Commit 59c85bf

Browse files
authored
Add link-index-updater AWS lambda deployment steps (#1185)
1 parent ca9d134 commit 59c85bf

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

.github/workflows/release.yml

+19-4
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,16 @@ jobs:
6666
run: ./build.sh publishcontainers
6767

6868
release-lambda:
69+
environment:
70+
name: link-index-updater-prod
6971
runs-on: ubuntu-latest
7072
needs:
7173
- release-drafter
7274
permissions:
7375
contents: write
76+
id-token: write
77+
env:
78+
ZIP_FILE: link-index-updater-lambda.zip
7479
steps:
7580
- uses: actions/checkout@v4
7681
with:
@@ -81,13 +86,23 @@ jobs:
8186
- name: Get bootstrap binary
8287
run: |
8388
docker cp $(docker create --name tc publish-links-index:latest):/app/.artifacts/publish ./.artifacts && docker rm tc
84-
85-
# TODO publish to AWS
89+
90+
- uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 # v4.1.0
91+
with:
92+
role-to-assume: arn:aws:iam::197730964718:role/elastic-docs-v3-link-index-updater-deployer
93+
aws-region: us-east-2
94+
95+
- name: Upload Lambda function
96+
run: |
97+
zip "${ZIP_FILE}" .artifacts/docs-lambda-index-publisher/release_linux-x64/bootstrap
98+
aws lambda update-function-code \
99+
--function-name elastic-docs-v3-link-index-updater \
100+
--zip-file "fileb://${ZIP_FILE}"
101+
86102
- name: Attach Distribution to release
87103
env:
88104
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89-
run: gh release upload ${{ needs.release-drafter.outputs.tag_name }} .artifacts/docs-lambda-index-publisher/release_linux-x64/bootstrap
90-
shell: bash
105+
run: gh release upload ${{ needs.release-drafter.outputs.tag_name }} "${ZIP_FILE}"
91106

92107
release:
93108
needs:

0 commit comments

Comments
 (0)