diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 03aa4a4e8..b6370a7a0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -66,11 +66,16 @@ jobs: run: ./build.sh publishcontainers release-lambda: + environment: + name: link-index-updater-prod runs-on: ubuntu-latest needs: - release-drafter permissions: contents: write + id-token: write + env: + ZIP_FILE: link-index-updater-lambda.zip steps: - uses: actions/checkout@v4 with: @@ -81,13 +86,23 @@ jobs: - name: Get bootstrap binary run: | docker cp $(docker create --name tc publish-links-index:latest):/app/.artifacts/publish ./.artifacts && docker rm tc - - # TODO publish to AWS + + - uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 # v4.1.0 + with: + role-to-assume: arn:aws:iam::197730964718:role/elastic-docs-v3-link-index-updater-deployer + aws-region: us-east-2 + + - name: Upload Lambda function + run: | + zip "${ZIP_FILE}" .artifacts/docs-lambda-index-publisher/release_linux-x64/bootstrap + aws lambda update-function-code \ + --function-name elastic-docs-v3-link-index-updater \ + --zip-file "fileb://${ZIP_FILE}" + - name: Attach Distribution to release env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: gh release upload ${{ needs.release-drafter.outputs.tag_name }} .artifacts/docs-lambda-index-publisher/release_linux-x64/bootstrap - shell: bash + run: gh release upload ${{ needs.release-drafter.outputs.tag_name }} "${ZIP_FILE}" release: needs: